Skip to content

Commit ac2411b

Browse files
committed
Merge branch '3.x' into main
2 parents 7d55cc3 + a8d7ba6 commit ac2411b

3 files changed

Lines changed: 19 additions & 10 deletions

File tree

cloudfoundry-client/src/main/java/org/cloudfoundry/client/v3/processes/HealthCheckType.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ public static HealthCheckType from(String s) {
5656
switch (s.toLowerCase()) {
5757
case "http":
5858
return HTTP;
59+
case "none":
60+
return NONE;
5961
case "port":
6062
return PORT;
6163
case "process":

cloudfoundry-client/src/main/java/org/cloudfoundry/client/v3/processes/ProcessState.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public enum ProcessState {
3232
/**
3333
* The down state
3434
*/
35-
DOWN("down"),
35+
DOWN("DOWN"),
3636

3737
/**
3838
* The running state
@@ -42,7 +42,7 @@ public enum ProcessState {
4242
/**
4343
* The starting state
4444
*/
45-
STARTING("starting");
45+
STARTING("STARTING");
4646

4747
private final String value;
4848

integration-test/src/test/java/org/cloudfoundry/client/v3/ProcessesTest.java

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
import reactor.test.StepVerifier;
4949

5050
import java.io.IOException;
51+
import java.nio.file.Path;
5152
import java.time.Duration;
5253

5354
import 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

Comments
 (0)