@@ -100,7 +100,6 @@ public final class ApplicationsTest extends AbstractIntegrationTest {
100100 private static final String DEFAULT_ROUTER_GROUP = "default-tcp" ;
101101
102102 @ Autowired private CloudFoundryOperations cloudFoundryOperations ;
103- @ Autowired private org .cloudfoundry .client .CloudFoundryClient cloudFoundryClient ;
104103
105104 @ Autowired private String organizationName ;
106105
@@ -794,57 +793,37 @@ public void pushManifestV3() throws IOException {
794793 @ IfCloudFoundryVersion (greaterThanOrEqualTo = CloudFoundryVersion .PCF_4_v2 )
795794 public void pushManifestV3WithMetadata () throws IOException {
796795 String applicationName = this .nameFactory .getApplicationName ();
797-
798- ManifestV3 manifest =
799- ManifestV3 .builder ()
800- .application (
801- ManifestV3Application .builder ()
802- .buildpack ("staticfile_buildpack" )
803- .disk (512 )
804- .healthCheckType (ApplicationHealthCheck .PORT )
805- .memory (64 )
806- .name (applicationName )
807- .metadata (
808- org .cloudfoundry .client .v3 .Metadata .builder ()
809- .label ("test-label" , "test-label-value" )
810- .annotation ("test-annotation" , "test-annotation-value" )
811- .build ()
812- )
813- .path (
814- new ClassPathResource ("test-application.zip" )
815- .getFile ()
816- .toPath ())
817- .build ())
818- .build ();
796+ Map <String , String > labels = Collections .singletonMap ("test-label" , "test-label-value" );
797+ Map <String , String > annotations = Collections .singletonMap ("test-annotation" , "test-annotation-value" );
819798
820799 this .cloudFoundryOperations
821800 .applications ()
822- .pushManifestV3 (PushManifestV3Request .builder ().manifest (manifest ).build ())
823- .then (
824- // fetch application id via operations API
825- this .cloudFoundryOperations
826- .applications ()
827- .get (
828- org .cloudfoundry .operations .applications .GetApplicationRequest
829- .builder ()
830- .name (applicationName )
801+ .pushManifestV3 (
802+ PushManifestV3Request .builder ()
803+ .manifest (
804+ ManifestV3 .builder ()
805+ .application (
806+ ManifestV3Application .builder ()
807+ .buildpack ("staticfile_buildpack" )
808+ .disk (512 )
809+ .healthCheckType (ApplicationHealthCheck .PORT )
810+ .memory (64 )
811+ .name (applicationName )
812+ .metadata (
813+ org .cloudfoundry .client .v3 .Metadata .builder ()
814+ .labels (labels )
815+ .annotations (annotations )
816+ .build ())
817+ .path (new ClassPathResource ("test-application.zip" ).getFile ().toPath ())
818+ .build ())
831819 .build ())
832- .map (org .cloudfoundry .operations .applications .ApplicationDetail ::getId ))
833- .flatMap (
834- appId ->
835- this .cloudFoundryClient
836- .applicationsV3 ()
837- .get (
838- org .cloudfoundry .client .v3 .applications
839- .GetApplicationRequest
840- .builder ()
841- .applicationId (appId )
842- .build ()))
843- .map (
844- response ->
845- response .getMetadata ().getLabels ().get ("test-label" ))
820+ .build ())
821+ .map (manifestm -> manifest .getMetadata ())
846822 .as (StepVerifier ::create )
847- .expectNext ("test-value" )
823+ .consumeNextWith (metadata -> {
824+ assertThat (metadata .getLabels ()).containsAllEntriesOf (labels );
825+ assertThat (metadata .getAnnotations ()).containsAllEntriesOf (annotations );
826+ })
848827 .expectComplete ()
849828 .verify (Duration .ofMinutes (5 ));
850829 }
0 commit comments