Skip to content

Commit 2a6f170

Browse files
committed
fix readiness and health check type serialization
1 parent b1a5fe5 commit 2a6f170

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

cloudfoundry-operations/src/main/java/org/cloudfoundry/operations/applications/ApplicationManifestUtilsV3.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,8 @@ private static Map<String, Object> toProcessYaml(ManifestV3Process process) {
315315
putIfPresent(yaml, "health-check-http-endpoint", process.getHealthCheckHttpEndpoint());
316316
putIfPresent(
317317
yaml, "health-check-invocation-timeout", process.getHealthCheckInvocationTimeout());
318-
putIfPresent(yaml, "health-check-type", process.getHealthCheckType().getValue());
319-
putIfPresent(yaml, "readiness-health-check-type", process.getReadinessHealthCheckType());
318+
putIfPresent(yaml, "health-check-type", process.getHealthCheckType(), HealthCheckType::getValue);
319+
putIfPresent(yaml, "readiness-health-check-type", process.getReadinessHealthCheckType(), ReadinessHealthCheckType::getValue);
320320
putIfPresent(
321321
yaml,
322322
"readiness-health-check-http-endpoint",

cloudfoundry-operations/src/test/java/org/cloudfoundry/operations/applications/ApplicationManifestUtilsV3Test.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
import java.io.IOException;
66
import java.nio.file.Files;
77
import java.nio.file.Path;
8+
9+
import org.cloudfoundry.client.v3.processes.ReadinessHealthCheckType;
810
import org.junit.jupiter.api.Test;
911

1012
class ApplicationManifestUtilsV3Test {
@@ -25,6 +27,14 @@ void testGenericApplication() throws IOException {
2527
.stack("test-stack")
2628
.timeout(120)
2729
.environmentVariable("TEST_KEY_1", "test-value-1")
30+
.processe(
31+
ManifestV3Process.builder()
32+
.type("web")
33+
.command("test-command-1")
34+
.readinessHealthCheckType(ReadinessHealthCheckType.HTTP)
35+
.readinessHealthCheckHttpEndpoint("test-readiness-health-check-http-endpoint")
36+
.readinessHealthCheckInvocationTimeout(120)
37+
.build())
2838
.service(
2939
ManifestV3Service.builder()
3040
.name("test-service-1")

0 commit comments

Comments
 (0)