Search in sources :

Example 1 with Route

use of org.cloudfoundry.operations.applications.Route in project cf-java-client by cloudfoundry.

the class ApplicationsTest method pushMultipleRoutes.

@Test
public void pushMultipleRoutes() throws IOException {
    String applicationName = this.nameFactory.getApplicationName();
    String domainName = this.nameFactory.getDomainName();
    requestCreateDomain(this.cloudFoundryOperations, domainName, this.organizationName).then(this.cloudFoundryOperations.applications().pushManifest(PushApplicationManifestRequest.builder().manifest(ApplicationManifest.builder().path(new ClassPathResource("test-application.zip").getFile().toPath()).buildpack("staticfile_buildpack").disk(512).healthCheckType(ApplicationHealthCheck.PORT).memory(64).name(applicationName).route(Route.builder().route(String.format("test1.%s", domainName)).build()).route(Route.builder().route(String.format("test2.%s", domainName)).build()).build()).noStart(false).build())).thenMany(this.cloudFoundryOperations.routes().list(ListRoutesRequest.builder().build())).filter(response -> domainName.equals(response.getDomain())).map(org.cloudfoundry.operations.routes.Route::getApplications).as(StepVerifier::create).expectNextCount(2).expectComplete().verify(Duration.ofMinutes(5));
}
Also used : StepVerifier(reactor.test.StepVerifier) GetApplicationManifestRequest(org.cloudfoundry.operations.applications.GetApplicationManifestRequest) PushApplicationRequest(org.cloudfoundry.operations.applications.PushApplicationRequest) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) Task(org.cloudfoundry.operations.applications.Task) ClassPathResource(org.springframework.core.io.ClassPathResource) Route(org.cloudfoundry.operations.applications.Route) Autowired(org.springframework.beans.factory.annotation.Autowired) AbstractIntegrationTest(org.cloudfoundry.AbstractIntegrationTest) ApplicationHealthCheck(org.cloudfoundry.operations.applications.ApplicationHealthCheck) TaskState(org.cloudfoundry.operations.applications.TaskState) CreateDomainRequest(org.cloudfoundry.operations.domains.CreateDomainRequest) RestartApplicationRequest(org.cloudfoundry.operations.applications.RestartApplicationRequest) DeleteApplicationRequest(org.cloudfoundry.operations.applications.DeleteApplicationRequest) ApplicationDetail(org.cloudfoundry.operations.applications.ApplicationDetail) ApplicationEnvironments(org.cloudfoundry.operations.applications.ApplicationEnvironments) ApplicationSummary(org.cloudfoundry.operations.applications.ApplicationSummary) IfCloudFoundryVersion(org.cloudfoundry.IfCloudFoundryVersion) Duration(java.time.Duration) Map(java.util.Map) GetApplicationEventsRequest(org.cloudfoundry.operations.applications.GetApplicationEventsRequest) RunApplicationTaskRequest(org.cloudfoundry.operations.applications.RunApplicationTaskRequest) CloudFoundryVersion(org.cloudfoundry.CloudFoundryVersion) GetApplicationEnvironmentsRequest(org.cloudfoundry.operations.applications.GetApplicationEnvironmentsRequest) ListApplicationTasksRequest(org.cloudfoundry.operations.applications.ListApplicationTasksRequest) CreateSharedDomainRequest(org.cloudfoundry.operations.domains.CreateSharedDomainRequest) CreateUserProvidedServiceInstanceRequest(org.cloudfoundry.operations.services.CreateUserProvidedServiceInstanceRequest) GetApplicationRequest(org.cloudfoundry.operations.applications.GetApplicationRequest) Path(java.nio.file.Path) ApplicationEvent(org.cloudfoundry.operations.applications.ApplicationEvent) GetServiceInstanceRequest(org.cloudfoundry.operations.services.GetServiceInstanceRequest) UnsetEnvironmentVariableApplicationRequest(org.cloudfoundry.operations.applications.UnsetEnvironmentVariableApplicationRequest) ServiceInstance(org.cloudfoundry.operations.services.ServiceInstance) Test(org.junit.Test) Mono(reactor.core.publisher.Mono) IOException(java.io.IOException) ApplicationManifest(org.cloudfoundry.operations.applications.ApplicationManifest) GetApplicationHealthCheckRequest(org.cloudfoundry.operations.applications.GetApplicationHealthCheckRequest) CreateServiceInstanceRequest(org.cloudfoundry.operations.services.CreateServiceInstanceRequest) Flux(reactor.core.publisher.Flux) BindServiceInstanceRequest(org.cloudfoundry.operations.services.BindServiceInstanceRequest) StartApplicationRequest(org.cloudfoundry.operations.applications.StartApplicationRequest) ListRoutesRequest(org.cloudfoundry.operations.routes.ListRoutesRequest) FluentMap(org.cloudfoundry.util.FluentMap) TerminateApplicationTaskRequest(org.cloudfoundry.operations.applications.TerminateApplicationTaskRequest) SetEnvironmentVariableApplicationRequest(org.cloudfoundry.operations.applications.SetEnvironmentVariableApplicationRequest) Collections(java.util.Collections) PushApplicationManifestRequest(org.cloudfoundry.operations.applications.PushApplicationManifestRequest) ClassPathResource(org.springframework.core.io.ClassPathResource) Route(org.cloudfoundry.operations.applications.Route) 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 Map (java.util.Map)1 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)1 AbstractIntegrationTest (org.cloudfoundry.AbstractIntegrationTest)1 CloudFoundryVersion (org.cloudfoundry.CloudFoundryVersion)1 IfCloudFoundryVersion (org.cloudfoundry.IfCloudFoundryVersion)1 ApplicationDetail (org.cloudfoundry.operations.applications.ApplicationDetail)1 ApplicationEnvironments (org.cloudfoundry.operations.applications.ApplicationEnvironments)1 ApplicationEvent (org.cloudfoundry.operations.applications.ApplicationEvent)1 ApplicationHealthCheck (org.cloudfoundry.operations.applications.ApplicationHealthCheck)1 ApplicationManifest (org.cloudfoundry.operations.applications.ApplicationManifest)1 ApplicationSummary (org.cloudfoundry.operations.applications.ApplicationSummary)1 DeleteApplicationRequest (org.cloudfoundry.operations.applications.DeleteApplicationRequest)1 GetApplicationEnvironmentsRequest (org.cloudfoundry.operations.applications.GetApplicationEnvironmentsRequest)1 GetApplicationEventsRequest (org.cloudfoundry.operations.applications.GetApplicationEventsRequest)1 GetApplicationHealthCheckRequest (org.cloudfoundry.operations.applications.GetApplicationHealthCheckRequest)1 GetApplicationManifestRequest (org.cloudfoundry.operations.applications.GetApplicationManifestRequest)1