Example #1
0
func (repo FakeSpaceRepository) ListSpaces(callback func(models.Space) bool) net.ApiResponse {
	for _, space := range repo.Spaces {
		if !callback(space) {
			break
		}
	}
	return net.NewApiResponseWithStatusCode(200)
}
func (repo *FakeServiceBrokerRepo) ListServiceBrokers(callback func(broker models.ServiceBroker) bool) net.ApiResponse {
	for _, broker := range repo.ServiceBrokers {
		if !callback(broker) {
			break
		}
	}

	if repo.ListErr {
		return net.NewApiResponseWithMessage("Error finding service brokers")
	} else {
		return net.NewApiResponseWithStatusCode(200)
	}
}
Example #3
0
func (repo *FakeBuildpackRepository) ListBuildpacks(cb func(models.Buildpack) bool) net.ApiResponse {
	for _, b := range repo.Buildpacks {
		cb(b)
	}
	return net.NewApiResponseWithStatusCode(200)
}
Example #4
0
func (repo *FakeUserRepository) ListUsersInSpaceForRole(spaceGuid string, roleName string) ([]models.UserFields, net.ApiResponse) {
	repo.ListUsersSpaceGuid = spaceGuid
	return repo.ListUsersByRole[roleName], net.NewApiResponseWithStatusCode(200)
}
Example #5
0
func (repo *FakeUserRepository) ListUsersInOrgForRole(orgGuid string, roleName string) ([]models.UserFields, net.ApiResponse) {
	repo.ListUsersOrganizationGuid = orgGuid
	return repo.ListUsersByRole[roleName], net.NewApiResponseWithStatusCode(200)
}