Search in sources :

Example 1 with Buildpack

use of org.cloudfoundry.operations.buildpacks.Buildpack in project cf-java-client by cloudfoundry.

the class BuildpacksTest method updateFromDirectory.

@Test
public void updateFromDirectory() throws IOException {
    String buildpackName = this.nameFactory.getBuildpackName();
    createBuildpack(this.cloudFoundryOperations, buildpackName).then(this.cloudFoundryOperations.buildpacks().update(UpdateBuildpackRequest.builder().buildpack(new ClassPathResource("test-buildpack").getFile().toPath()).enable(true).name(buildpackName).build())).thenMany(this.cloudFoundryOperations.buildpacks().list()).filter(buildpack -> buildpackName.equals(buildpack.getName())).map(Buildpack::getFilename).as(StepVerifier::create).expectNext("test-buildpack.zip").expectComplete().verify(Duration.ofMinutes(5));
}
Also used : DeleteBuildpackRequest(org.cloudfoundry.operations.buildpacks.DeleteBuildpackRequest) StepVerifier(reactor.test.StepVerifier) 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) Test(org.junit.Test) Mono(reactor.core.publisher.Mono) IOException(java.io.IOException) Buildpack(org.cloudfoundry.operations.buildpacks.Buildpack) Duration(java.time.Duration) UpdateBuildpackRequest(org.cloudfoundry.operations.buildpacks.UpdateBuildpackRequest) CreateBuildpackRequest(org.cloudfoundry.operations.buildpacks.CreateBuildpackRequest) Buildpack(org.cloudfoundry.operations.buildpacks.Buildpack) ClassPathResource(org.springframework.core.io.ClassPathResource) AbstractIntegrationTest(org.cloudfoundry.AbstractIntegrationTest) Test(org.junit.Test)

Aggregations

IOException (java.io.IOException)1 Duration (java.time.Duration)1 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)1 AbstractIntegrationTest (org.cloudfoundry.AbstractIntegrationTest)1 Buildpack (org.cloudfoundry.operations.buildpacks.Buildpack)1 CreateBuildpackRequest (org.cloudfoundry.operations.buildpacks.CreateBuildpackRequest)1 DeleteBuildpackRequest (org.cloudfoundry.operations.buildpacks.DeleteBuildpackRequest)1 UpdateBuildpackRequest (org.cloudfoundry.operations.buildpacks.UpdateBuildpackRequest)1 Test (org.junit.Test)1 Autowired (org.springframework.beans.factory.annotation.Autowired)1 ClassPathResource (org.springframework.core.io.ClassPathResource)1 Mono (reactor.core.publisher.Mono)1 StepVerifier (reactor.test.StepVerifier)1