}, nil, nil } Fail("Unexpected route-guid") return []ccv2.Application{}, nil, nil } }) Context("when there are orphaned routes", func() { BeforeEach(func() { fakeCloudControllerClient.GetSpaceRoutesReturns([]ccv2.Route{ { GUID: "orphaned-route-guid-1", DomainGUID: "some-domain-guid", }, { GUID: "orphaned-route-guid-2", DomainGUID: "some-other-domain-guid", }, { GUID: "not-orphaned-route-guid-3", DomainGUID: "not-orphaned-route-domain-guid", }, }, nil, nil) fakeCloudControllerClient.GetSharedDomainStub = func(domainGUID string) (ccv2.Domain, ccv2.Warnings, error) { switch domainGUID { case "some-domain-guid": return ccv2.Domain{ GUID: "some-domain-guid", Name: "some-domain.com", }, nil, nil case "some-other-domain-guid": return ccv2.Domain{