func callApi(args []string, config core_config.Repository, endpointRepo *testapi.FakeEndpointRepo) (ui *testterm.FakeUI) { ui = new(testterm.FakeUI) // cmd := NewApi(ui, config, endpointRepo) var cmd command_registry.Command cmd = Api{} repoLocator := api.RepositoryLocator{} repoLocator = repoLocator.SetEndpointRepository(endpointRepo) deps := command_registry.Dependency{ Ui: ui, Config: config, RepoLocator: repoLocator, } cmd = cmd.SetDependency(deps, false) requirementsFactory := &testreq.FakeReqFactory{} testcmd.RunCliCommand(cmd, args, requirementsFactory) return }