use of reactor.test.StepVerifier in project cf-java-client by cloudfoundry.
the class ApplicationsTest method pushNoHostName.
@Test
public void pushNoHostName() throws IOException {
String applicationName = this.nameFactory.getApplicationName();
String domainName = this.nameFactory.getDomainName();
requestCreateDomain(this.cloudFoundryOperations, domainName, this.organizationName).then(this.cloudFoundryOperations.applications().push(PushApplicationRequest.builder().path(new ClassPathResource("test-application.zip").getFile().toPath()).buildpack("staticfile_buildpack").diskQuota(512).domain(domainName).healthCheckType(ApplicationHealthCheck.PORT).memory(64).name(applicationName).noHostname(true).noStart(false).build())).thenMany(this.cloudFoundryOperations.routes().list(ListRoutesRequest.builder().build())).filter(response -> domainName.equals(response.getDomain())).map(org.cloudfoundry.operations.routes.Route::getHost).as(StepVerifier::create).expectNext("").expectComplete().verify(Duration.ofMinutes(5));
}
use of reactor.test.StepVerifier in project cf-java-client by cloudfoundry.
the class ApplicationsTest method restartStarted.
@Test
public void restartStarted() throws IOException {
String applicationName = this.nameFactory.getApplicationName();
createApplication(this.cloudFoundryOperations, new ClassPathResource("test-application.zip").getFile().toPath(), applicationName, false).then(this.cloudFoundryOperations.applications().restart(RestartApplicationRequest.builder().name(applicationName).build())).as(StepVerifier::create).expectComplete().verify(Duration.ofMinutes(5));
}
use of reactor.test.StepVerifier in project cf-java-client by cloudfoundry.
the class RoutesTest method unmapNoPath.
@Test
public void unmapNoPath() throws IOException {
String applicationName = this.nameFactory.getApplicationName();
String domainName = this.nameFactory.getDomainName();
String hostName = this.nameFactory.getHostName();
String path = null;
Mono.when(createDomainAndRoute(this.cloudFoundryOperations, this.organizationName, this.spaceName, domainName, hostName, path), requestCreateApplication(this.cloudFoundryOperations, new ClassPathResource("test-application.zip").getFile().toPath(), applicationName, true)).then(requestMapRoute(this.cloudFoundryOperations, applicationName, domainName, hostName, path)).then(this.cloudFoundryOperations.routes().unmap(UnmapRouteRequest.builder().applicationName(applicationName).domain(domainName).host(hostName).path(path).build())).thenMany(requestListRoutes(this.cloudFoundryOperations)).filter(filterRoutes(domainName, hostName, path, applicationName)).as(StepVerifier::create).expectComplete().verify(Duration.ofMinutes(5));
}
use of reactor.test.StepVerifier in project cf-java-client by cloudfoundry.
the class RoutesTest method unmapTcpRoute.
@Test
public void unmapTcpRoute() throws IOException {
String applicationName = this.nameFactory.getApplicationName();
String domainName = this.nameFactory.getDomainName();
requestCreateApplication(this.cloudFoundryOperations, new ClassPathResource("test-application.zip").getFile().toPath(), applicationName, true).then(createSharedDomainAndTcpRoute(this.cloudFoundryOperations, domainName, this.spaceName)).flatMap(port -> requestMapRoute(this.cloudFoundryOperations, applicationName, domainName, port)).flatMap(port -> this.cloudFoundryOperations.routes().unmap(UnmapRouteRequest.builder().applicationName(applicationName).domain(domainName).port(port).build())).thenMany(requestListRoutes(this.cloudFoundryOperations)).filter(response -> domainName.equals(response.getDomain())).map(route -> route.getApplications().size()).as(StepVerifier::create).expectNext(0).expectComplete().verify(Duration.ofMinutes(5));
}
use of reactor.test.StepVerifier in project cf-java-client by cloudfoundry.
the class ClientsTest method batchDelete.
@Test
public void batchDelete() {
String clientId1 = this.nameFactory.getClientId();
String clientId2 = this.nameFactory.getClientId();
String clientSecret = this.nameFactory.getClientSecret();
batchCreateClients(this.uaaClient, clientId1, clientId2, clientSecret).flatMapIterable(BatchCreateClientsResponse::getClients).map(Client::getClientId).collectList().flatMap(clientIds -> this.uaaClient.clients().batchDelete(BatchDeleteClientsRequest.builder().clientIds(clientIds).build())).thenMany(requestListClients(this.uaaClient)).filter(client -> clientId1.equals(client.getClientId()) || clientId2.equals(client.getClientId())).as(StepVerifier::create).expectComplete().verify(Duration.ofMinutes(5));
}
Aggregations