@@ -497,7 +497,6 @@ private static void requestCreateApplication(CloudFoundryClient cloudFoundryClie
497497 .buildpack (request .getBuildpack ())
498498 .command (request .getCommand ())
499499 .diskQuota (request .getDiskQuota ())
500- .dockerImage (request .getDockerImage ())
501500 .healthCheckTimeout (request .getTimeout ())
502501 .healthCheckType (Optional .ofNullable (request .getHealthCheckType ()).map (ApplicationHealthCheck ::getValue ).orElse (null ))
503502 .instances (request .getInstances ())
@@ -512,7 +511,30 @@ private static void requestCreateApplication(CloudFoundryClient cloudFoundryClie
512511 .id (applicationId )
513512 .build ())
514513 .build ()));
514+ }
515515
516+ private static void requestCreateDockerApplication (CloudFoundryClient cloudFoundryClient , PushApplicationRequest request , String spaceId , String stackId , String applicationId ) {
517+ when (cloudFoundryClient .applicationsV2 ()
518+ .create (CreateApplicationRequest .builder ()
519+ .buildpack (request .getBuildpack ())
520+ .command (request .getCommand ())
521+ .diego (true )
522+ .diskQuota (request .getDiskQuota ())
523+ .dockerImage (request .getDockerImage ())
524+ .healthCheckTimeout (request .getTimeout ())
525+ .healthCheckType (Optional .ofNullable (request .getHealthCheckType ()).map (ApplicationHealthCheck ::getValue ).orElse (null ))
526+ .instances (request .getInstances ())
527+ .memory (request .getMemory ())
528+ .name (request .getName ())
529+ .spaceId (spaceId )
530+ .stackId (stackId )
531+ .build ()))
532+ .thenReturn (Mono
533+ .just (fill (CreateApplicationResponse .builder (), "create-" )
534+ .metadata (fill (Metadata .builder ())
535+ .id (applicationId )
536+ .build ())
537+ .build ()));
516538 }
517539
518540 private static void requestCreateRoute (CloudFoundryClient cloudFoundryClient , String domainId , String host , String path , String spaceId , String routeId ) {
@@ -2515,7 +2537,7 @@ public static final class PushDocker extends AbstractOperationsApiTest<Void> {
25152537 @ Before
25162538 public void setUp () throws Exception {
25172539 requestApplicationsEmpty (this .cloudFoundryClient , "test-name" , TEST_SPACE_ID );
2518- requestCreateApplication (this .cloudFoundryClient , this .pushApplicationRequest , TEST_SPACE_ID , null , "test-application-id" );
2540+ requestCreateDockerApplication (this .cloudFoundryClient , this .pushApplicationRequest , TEST_SPACE_ID , null , "test-application-id" );
25192541 requestSpace (this .cloudFoundryClient , TEST_SPACE_ID , TEST_ORGANIZATION_ID );
25202542 requestPrivateDomain (this .cloudFoundryClient , "test-domain" , TEST_ORGANIZATION_ID , "test-domain-id" );
25212543 requestRoutesEmpty (this .cloudFoundryClient , "test-domain-id" , "test-name" , null );
0 commit comments