Skip to content

Commit 8117875

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

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

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

+7-2
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,13 @@ 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(
319+
yaml, "health-check-type", process.getHealthCheckType(), HealthCheckType::getValue);
320+
putIfPresent(
321+
yaml,
322+
"readiness-health-check-type",
323+
process.getReadinessHealthCheckType(),
324+
ReadinessHealthCheckType::getValue);
320325
putIfPresent(
321326
yaml,
322327
"readiness-health-check-http-endpoint",

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

+11
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import java.io.IOException;
66
import java.nio.file.Files;
77
import java.nio.file.Path;
8+
import org.cloudfoundry.client.v3.processes.ReadinessHealthCheckType;
89
import org.junit.jupiter.api.Test;
910

1011
class ApplicationManifestUtilsV3Test {
@@ -25,6 +26,16 @@ void testGenericApplication() throws IOException {
2526
.stack("test-stack")
2627
.timeout(120)
2728
.environmentVariable("TEST_KEY_1", "test-value-1")
29+
.processe(
30+
ManifestV3Process.builder()
31+
.type("web")
32+
.command("test-command-1")
33+
.readinessHealthCheckType(
34+
ReadinessHealthCheckType.HTTP)
35+
.readinessHealthCheckHttpEndpoint(
36+
"test-readiness-health-check-http-endpoint")
37+
.readinessHealthCheckInvocationTimeout(120)
38+
.build())
2839
.service(
2940
ManifestV3Service.builder()
3041
.name("test-service-1")

0 commit comments

Comments
 (0)