use of org.cloudfoundry.client.v2.organizations.ListOrganizationDomainsResponse in project promregator by promregator.
the class CFAccessorSimulator method retrieveAllDomains.
@Override
public Mono<ListOrganizationDomainsResponse> retrieveAllDomains(String orgId) {
List<DomainResource> domains = new ArrayList<DomainResource>();
for (int i = 1; i <= 100; i++) {
DomainResource domain = DomainResource.builder().entity(DomainEntity.builder().name(SHARED_DOMAIN).internal(false).build()).metadata(Metadata.builder().id(SHARED_DOMAIN_UUID + i).createdAt(CREATED_AT_TIMESTAMP).build()).build();
domains.add(domain);
}
DomainResource domain = DomainResource.builder().entity(DomainEntity.builder().name(INTERNAL_DOMAIN).internal(true).build()).metadata(Metadata.builder().id(INTERNAL_DOMAIN_UUID).createdAt(CREATED_AT_TIMESTAMP).build()).build();
domains.add(domain);
ListOrganizationDomainsResponse response = ListOrganizationDomainsResponse.builder().addAllResources(domains).build();
return Mono.just(response);
}
use of org.cloudfoundry.client.v2.organizations.ListOrganizationDomainsResponse in project promregator by promregator.
the class CFAccessorSimulatorTest method testRetrieveAllDomains.
@Test
void testRetrieveAllDomains() {
CFAccessorSimulator subject = new CFAccessorSimulator(2);
Mono<ListOrganizationDomainsResponse> mono = subject.retrieveAllDomains(CFAccessorSimulator.ORG_UUID);
ListOrganizationDomainsResponse result = mono.block();
Assertions.assertNotNull(result);
Assertions.assertNotNull(result.getResources());
Assertions.assertEquals(101, result.getResources().size());
for (int i = 0; i <= 99; i++) {
int domainSequenceId = i + 1;
DomainResource item = result.getResources().get(i);
Assertions.assertEquals(CFAccessorSimulator.SHARED_DOMAIN, item.getEntity().getName());
Assertions.assertFalse(item.getEntity().getInternal());
Assertions.assertTrue(item.getMetadata().getId().contains(CFAccessorSimulator.SHARED_DOMAIN_UUID + domainSequenceId));
}
// get the shared domain
DomainResource sharedDomain = result.getResources().get(100);
Assertions.assertTrue(sharedDomain.getEntity().getInternal());
Assertions.assertEquals(CFAccessorSimulator.INTERNAL_DOMAIN, sharedDomain.getEntity().getName());
}
use of org.cloudfoundry.client.v2.organizations.ListOrganizationDomainsResponse in project promregator by promregator.
the class CFAccessorMock method retrieveAllDomains.
@Override
public Mono<ListOrganizationDomainsResponse> retrieveAllDomains(String orgId) {
List<DomainResource> domains = new ArrayList<DomainResource>();
DomainResource domain = DomainResource.builder().entity(DomainEntity.builder().name(UNITTEST_INTERNAL_DOMAIN).internal(true).build()).metadata(Metadata.builder().id(UNITTEST_INTERNAL_DOMAIN_UUID).createdAt(CREATED_AT_TIMESTAMP).build()).build();
domains.add(domain);
domain = DomainResource.builder().entity(DomainEntity.builder().name(UNITTEST_SHARED_DOMAIN).internal(false).build()).metadata(Metadata.builder().id(UNITTEST_SHARED_DOMAIN_UUID).createdAt(CREATED_AT_TIMESTAMP).build()).build();
domains.add(domain);
domain = DomainResource.builder().entity(DomainEntity.builder().name(UNITTEST_ADDITIONAL_SHARED_DOMAIN).internal(false).build()).metadata(Metadata.builder().id(UNITTEST_ADDITIONAL_SHARED_DOMAIN_UUID).createdAt(CREATED_AT_TIMESTAMP).build()).build();
domains.add(domain);
ListOrganizationDomainsResponse response = ListOrganizationDomainsResponse.builder().addAllResources(domains).build();
return Mono.just(response);
}
use of org.cloudfoundry.client.v2.organizations.ListOrganizationDomainsResponse in project promregator by promregator.
the class CFAccessorMassMock method retrieveAllDomains.
@Override
public Mono<ListOrganizationDomainsResponse> retrieveAllDomains(String orgId) {
List<DomainResource> domains = new ArrayList<DomainResource>();
for (int i = 0; i < 100; i++) {
DomainResource domain = DomainResource.builder().entity(DomainEntity.builder().name(UNITTEST_SHARED_DOMAIN).internal(false).build()).metadata(Metadata.builder().id(UNITTEST_SHARED_DOMAIN_UUID + i).createdAt(CREATED_AT_TIMESTAMP).build()).build();
domains.add(domain);
}
ListOrganizationDomainsResponse response = ListOrganizationDomainsResponse.builder().addAllResources(domains).build();
return Mono.just(response);
}
Aggregations