4848import reactor .test .StepVerifier ;
4949
5050import java .io .IOException ;
51+ import java .nio .file .Path ;
5152import java .time .Duration ;
5253
5354import static org .assertj .core .api .Assertions .assertThat ;
@@ -64,8 +65,9 @@ public final class ProcessesTest extends AbstractIntegrationTest {
6465 @ Test
6566 public void get () throws IOException {
6667 String applicationName = this .nameFactory .getApplicationName ();
68+ Path path = new ClassPathResource ("test-application.zip" ).getFile ().toPath ();
6769
68- createApplication (this .cloudFoundryOperations , applicationName )
70+ createApplication (this .cloudFoundryOperations , applicationName , path )
6971 .then (getApplicationId (this .cloudFoundryOperations , applicationName ))
7072 .flatMap (applicationId -> getProcessId (this .cloudFoundryClient , applicationId ))
7173 .flatMap (processId -> this .cloudFoundryClient .processes ()
@@ -82,8 +84,9 @@ public void get() throws IOException {
8284 @ Test
8385 public void getStatistics () throws IOException {
8486 String applicationName = this .nameFactory .getApplicationName ();
87+ Path path = new ClassPathResource ("test-application.zip" ).getFile ().toPath ();
8588
86- createApplication (this .cloudFoundryOperations , applicationName )
89+ createApplication (this .cloudFoundryOperations , applicationName , path )
8790 .then (getApplicationId (this .cloudFoundryOperations , applicationName ))
8891 .flatMap (applicationId -> getProcessId (this .cloudFoundryClient , applicationId ))
8992 .flatMap (processId -> this .cloudFoundryClient .processes ()
@@ -101,8 +104,9 @@ public void getStatistics() throws IOException {
101104 @ Test
102105 public void list () throws IOException {
103106 String applicationName = this .nameFactory .getApplicationName ();
107+ Path path = new ClassPathResource ("test-application.zip" ).getFile ().toPath ();
104108
105- createApplication (this .cloudFoundryOperations , applicationName )
109+ createApplication (this .cloudFoundryOperations , applicationName , path )
106110 .then (getApplicationId (this .cloudFoundryOperations , applicationName ))
107111 .flatMap (applicationId -> getProcessId (this .cloudFoundryClient , applicationId ))
108112 .flatMapMany (processId -> PaginationUtils .requestClientV3Resources (page -> this .cloudFoundryClient .processes ()
@@ -120,8 +124,9 @@ public void list() throws IOException {
120124 @ Test
121125 public void scale () throws IOException {
122126 String applicationName = this .nameFactory .getApplicationName ();
127+ Path path = new ClassPathResource ("test-application.zip" ).getFile ().toPath ();
123128
124- createApplication (this .cloudFoundryOperations , applicationName )
129+ createApplication (this .cloudFoundryOperations , applicationName , path )
125130 .then (getApplicationId (this .cloudFoundryOperations , applicationName ))
126131 .flatMap (applicationId -> getProcessId (this .cloudFoundryClient , applicationId ))
127132 .flatMap (processId -> this .cloudFoundryClient .processes ()
@@ -141,8 +146,9 @@ public void scale() throws IOException {
141146 @ Test
142147 public void terminateInstance () throws IOException {
143148 String applicationName = this .nameFactory .getApplicationName ();
149+ Path path = new ClassPathResource ("test-application.zip" ).getFile ().toPath ();
144150
145- createApplication (this .cloudFoundryOperations , applicationName )
151+ createApplication (this .cloudFoundryOperations , applicationName , path )
146152 .then (getApplicationId (this .cloudFoundryOperations , applicationName ))
147153 .flatMap (applicationId -> getProcessId (this .cloudFoundryClient , applicationId ))
148154 .flatMap (processId -> this .cloudFoundryClient .processes ()
@@ -160,8 +166,9 @@ public void terminateInstance() throws IOException {
160166 @ Test
161167 public void update () throws IOException {
162168 String applicationName = this .nameFactory .getApplicationName ();
169+ Path path = new ClassPathResource ("test-application.zip" ).getFile ().toPath ();
163170
164- createApplication (this .cloudFoundryOperations , applicationName )
171+ createApplication (this .cloudFoundryOperations , applicationName , path )
165172 .then (getApplicationId (this .cloudFoundryOperations , applicationName ))
166173 .flatMap (applicationId -> getProcessId (this .cloudFoundryClient , applicationId ))
167174 .flatMap (processId -> this .cloudFoundryClient .processes ()
@@ -181,15 +188,15 @@ public void update() throws IOException {
181188 .verify (Duration .ofMinutes (5 ));
182189 }
183190
184- private static Mono <Void > createApplication (CloudFoundryOperations cloudFoundryOperations , String name ) throws IOException {
191+ private static Mono <Void > createApplication (CloudFoundryOperations cloudFoundryOperations , String name , Path path ) throws IOException {
185192 return cloudFoundryOperations .applications ()
186193 .push (PushApplicationRequest .builder ()
187194 .buildpack ("staticfile_buildpack" )
188195 .diskQuota (258 )
189196 .healthCheckType (ApplicationHealthCheck .PORT )
190197 .memory (64 )
191198 .name (name )
192- .path (new ClassPathResource ( "test-application.zip" ). getFile (). toPath () )
199+ .path (path )
193200 .noStart (false )
194201 .build ());
195202 }
0 commit comments