Skip to content

Commit a892ebc

Browse files
committed
involve cloudFoundryClient in operations ApplicationsTest to verify manefest metadata after pushing
1 parent bb9b252 commit a892ebc

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

integration-test/src/test/java/org/cloudfoundry/operations/ApplicationsTest.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import org.cloudfoundry.CleanupCloudFoundryAfterClass;
3030
import org.cloudfoundry.CloudFoundryVersion;
3131
import org.cloudfoundry.IfCloudFoundryVersion;
32+
import org.cloudfoundry.client.CloudFoundryClient;
3233
import org.cloudfoundry.logcache.v1.Envelope;
3334
import org.cloudfoundry.logcache.v1.EnvelopeBatch;
3435
import org.cloudfoundry.logcache.v1.EnvelopeType;
@@ -108,6 +109,7 @@ public final class ApplicationsTest extends AbstractIntegrationTest {
108109
@Autowired private String serviceName;
109110

110111
@Autowired private LogCacheClient logCacheClient;
112+
@Autowired private CloudFoundryClient cloudFoundryClient;
111113

112114
// To create a service in #pushBindService, the Service Broker must be installed first.
113115
// We ensure it is by loading the serviceBrokerId @Lazy bean.
@@ -821,7 +823,26 @@ public void pushManifestV3WithMetadata() throws IOException {
821823
this.cloudFoundryOperations
822824
.applications()
823825
.pushManifestV3(PushManifestV3Request.builder().manifest(manifest).build())
826+
.then(
827+
this.cloudFoundryOperations
828+
.applications()
829+
.get(GetApplicationRequest.builder().name(applicationName).build()))
830+
.map(ApplicationDetail::getId)
831+
.flatMap(
832+
id ->
833+
this.cloudFoundryClient
834+
.applicationsV3()
835+
.get(
836+
org.cloudfoundry.client.v3.applications
837+
.GetApplicationRequest.builder()
838+
.applicationId(id)
839+
.build()))
824840
.as(StepVerifier::create)
841+
.expectNextMatches(
842+
createdApp ->
843+
labels.equals(createdApp.getMetadata().getLabels())
844+
&& annotations.equals(
845+
createdApp.getMetadata().getAnnotations()))
825846
.expectComplete()
826847
.verify(Duration.ofMinutes(5));
827848
}

0 commit comments

Comments
 (0)