Exemple #1
0
		orgRepo = &organizationsfakes.FakeOrganizationRepository{}
		orgRepo.ListOrgsReturns([]models.Organization{org}, nil)

		space := models.Space{}
		space.GUID = "my-space-guid"
		space.Name = "my-space"

		spaceRepo = new(apifakes.FakeSpaceRepository)
		spaceRepo.ListSpacesStub = listSpacesStub([]models.Space{space})

		authRepo.GetLoginPromptsAndSaveUAAServerURLReturns(map[string]coreconfig.AuthPrompt{
			"username": {
				DisplayName: "Username",
				Type:        coreconfig.AuthPromptTypeText,
			},
			"password": {
				DisplayName: "Password",
				Type:        coreconfig.AuthPromptTypePassword,
			},
		}, nil)
	})

	Context("interactive usage", func() {
		JustBeforeEach(func() {
			endpointRepo.GetCCInfoStub = func(endpoint string) (*coreconfig.CCInfo, string, error) {
				return &coreconfig.CCInfo{
					APIVersion:               "some-version",
					AuthorizationEndpoint:    "auth/endpoint",
					LoggregatorEndpoint:      "loggregator/endpoint",
					MinCLIVersion:            minCLIVersion,
					MinRecommendedCLIVersion: minRecommendedCLIVersion,