use of reactor.test.StepVerifier in project cf-java-client by cloudfoundry.
the class ApplicationsTest method uploadDroplet.
@IfCloudFoundryVersion(greaterThanOrEqualTo = CloudFoundryVersion.PCF_1_9)
@Test
public void uploadDroplet() {
String applicationName = this.nameFactory.getApplicationName();
this.spaceId.flatMap(spaceId -> createApplicationId(this.cloudFoundryClient, spaceId, applicationName)).flatMap(applicationId -> {
try {
return this.cloudFoundryClient.applicationsV2().uploadDroplet(UploadApplicationDropletRequest.builder().applicationId(applicationId).droplet(new ClassPathResource("test-droplet.tgz").getFile().toPath()).build()).flatMap(job -> JobUtils.waitForCompletion(this.cloudFoundryClient, Duration.ofMinutes(5), job));
} catch (IOException e) {
throw new RuntimeException(e);
}
}).as(StepVerifier::create).expectComplete().verify(Duration.ofMinutes(5));
}
use of reactor.test.StepVerifier in project cf-java-client by cloudfoundry.
the class BuildpacksTest method uploadDirectory.
@Test
public void uploadDirectory() throws IOException {
Path buildpack = new ClassPathResource("test-buildpack").getFile().toPath();
String buildpackName = this.nameFactory.getBuildpackName();
String filename = buildpack.getFileName().toString();
createBuildpackId(this.cloudFoundryClient, buildpackName).flatMap(buildpackId -> this.cloudFoundryClient.buildpacks().upload(UploadBuildpackRequest.builder().buildpack(buildpack).buildpackId(buildpackId).filename(filename).build())).map(ResourceUtils::getEntity).as(StepVerifier::create).expectNext(BuildpackEntity.builder().enabled(false).filename(filename + ".zip").locked(false).name(buildpackName).position(3).build()).expectComplete().verify(Duration.ofMinutes(5));
}
use of reactor.test.StepVerifier in project cf-java-client by cloudfoundry.
the class ApplicationsTest method pushDomainNotFound.
@Test
public void pushDomainNotFound() throws IOException {
String applicationName = this.nameFactory.getApplicationName();
String domainName = this.nameFactory.getDomainName();
this.cloudFoundryOperations.applications().push(PushApplicationRequest.builder().path(new ClassPathResource("test-application.zip").getFile().toPath()).buildpack("staticfile_buildpack").domain(domainName).diskQuota(512).memory(64).name(applicationName).build()).as(StepVerifier::create).consumeErrorWith(t -> assertThat(t).isInstanceOf(IllegalArgumentException.class).hasMessage("Domain %s not found", domainName)).verify(Duration.ofMinutes(5));
}
use of reactor.test.StepVerifier in project cf-java-client by cloudfoundry.
the class ApplicationsTest method pushNoRoute.
@Test
public void pushNoRoute() throws IOException {
String applicationName = this.nameFactory.getApplicationName();
String domainName = this.nameFactory.getDomainName();
createDomain(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).memory(64).name(applicationName).noStart(true).build())).then(this.cloudFoundryOperations.applications().push(PushApplicationRequest.builder().path(new ClassPathResource("test-application.zip").getFile().toPath()).buildpack("staticfile_buildpack").diskQuota(512).memory(64).name(applicationName).noRoute(true).noStart(true).build())).thenMany(requestListRoutes(this.cloudFoundryOperations)).flatMapIterable(org.cloudfoundry.operations.routes.Route::getApplications).filter(applicationName::equals).as(StepVerifier::create).expectComplete().verify(Duration.ofMinutes(5));
}
use of reactor.test.StepVerifier in project cf-java-client by cloudfoundry.
the class ApplicationsTest method deleteApplication.
@Test
public void deleteApplication() throws IOException {
String applicationName = this.nameFactory.getApplicationName();
createApplication(this.cloudFoundryOperations, new ClassPathResource("test-application.zip").getFile().toPath(), applicationName, false).then(this.cloudFoundryOperations.applications().delete(DeleteApplicationRequest.builder().name(applicationName).build())).thenMany(requestListApplications(this.cloudFoundryOperations)).filter(response -> applicationName.equals(response.getName())).as(StepVerifier::create).expectComplete().verify(Duration.ofMinutes(5));
}
Aggregations