Search in sources :

Example 1 with Route

use of org.cloudfoundry.operations.routes.Route 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));
}
Also used : UnmapRouteRequest(org.cloudfoundry.operations.routes.UnmapRouteRequest) StepVerifier(reactor.test.StepVerifier) DeleteOrphanedRoutesRequest(org.cloudfoundry.operations.routes.DeleteOrphanedRoutesRequest) SPACE(org.cloudfoundry.operations.routes.Level.SPACE) PushApplicationRequest(org.cloudfoundry.operations.applications.PushApplicationRequest) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) ClassPathResource(org.springframework.core.io.ClassPathResource) Autowired(org.springframework.beans.factory.annotation.Autowired) AbstractIntegrationTest(org.cloudfoundry.AbstractIntegrationTest) ORGANIZATION(org.cloudfoundry.operations.routes.Level.ORGANIZATION) ApplicationHealthCheck(org.cloudfoundry.operations.applications.ApplicationHealthCheck) MapRouteRequest(org.cloudfoundry.operations.routes.MapRouteRequest) CreateRouteRequest(org.cloudfoundry.operations.routes.CreateRouteRequest) CreateDomainRequest(org.cloudfoundry.operations.domains.CreateDomainRequest) BindRouteServiceInstanceRequest(org.cloudfoundry.operations.services.BindRouteServiceInstanceRequest) Duration(java.time.Duration) CreateSharedDomainRequest(org.cloudfoundry.operations.domains.CreateSharedDomainRequest) CreateUserProvidedServiceInstanceRequest(org.cloudfoundry.operations.services.CreateUserProvidedServiceInstanceRequest) Path(java.nio.file.Path) Route(org.cloudfoundry.operations.routes.Route) Predicate(java.util.function.Predicate) Test(org.junit.Test) Mono(reactor.core.publisher.Mono) IOException(java.io.IOException) Flux(reactor.core.publisher.Flux) CheckRouteRequest(org.cloudfoundry.operations.routes.CheckRouteRequest) DeleteRouteRequest(org.cloudfoundry.operations.routes.DeleteRouteRequest) ListRoutesRequest(org.cloudfoundry.operations.routes.ListRoutesRequest) Optional(java.util.Optional) Collections(java.util.Collections) ClassPathResource(org.springframework.core.io.ClassPathResource) AbstractIntegrationTest(org.cloudfoundry.AbstractIntegrationTest) Test(org.junit.Test)

Aggregations

IOException (java.io.IOException)1 Path (java.nio.file.Path)1 Duration (java.time.Duration)1 Collections (java.util.Collections)1 Optional (java.util.Optional)1 Predicate (java.util.function.Predicate)1 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)1 AbstractIntegrationTest (org.cloudfoundry.AbstractIntegrationTest)1 ApplicationHealthCheck (org.cloudfoundry.operations.applications.ApplicationHealthCheck)1 PushApplicationRequest (org.cloudfoundry.operations.applications.PushApplicationRequest)1 CreateDomainRequest (org.cloudfoundry.operations.domains.CreateDomainRequest)1 CreateSharedDomainRequest (org.cloudfoundry.operations.domains.CreateSharedDomainRequest)1 CheckRouteRequest (org.cloudfoundry.operations.routes.CheckRouteRequest)1 CreateRouteRequest (org.cloudfoundry.operations.routes.CreateRouteRequest)1 DeleteOrphanedRoutesRequest (org.cloudfoundry.operations.routes.DeleteOrphanedRoutesRequest)1 DeleteRouteRequest (org.cloudfoundry.operations.routes.DeleteRouteRequest)1 ORGANIZATION (org.cloudfoundry.operations.routes.Level.ORGANIZATION)1 SPACE (org.cloudfoundry.operations.routes.Level.SPACE)1 ListRoutesRequest (org.cloudfoundry.operations.routes.ListRoutesRequest)1 MapRouteRequest (org.cloudfoundry.operations.routes.MapRouteRequest)1