From 3888a14b1ac1969a43f493cdeda34c7cdb9b9338 Mon Sep 17 00:00:00 2001 From: Tristan Hanson Date: Fri, 12 Jul 2024 02:42:21 +0000 Subject: [PATCH] Add support for creating V3 deployment with rolling strategy --- .../v3/deployments/_CreateDeploymentRequest.java | 4 ++++ .../deployments/CreateDeploymentRequestTest.java | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/cloudfoundry-client/src/main/java/org/cloudfoundry/client/v3/deployments/_CreateDeploymentRequest.java b/cloudfoundry-client/src/main/java/org/cloudfoundry/client/v3/deployments/_CreateDeploymentRequest.java index 9b253d8d4d..3bcfa86b83 100644 --- a/cloudfoundry-client/src/main/java/org/cloudfoundry/client/v3/deployments/_CreateDeploymentRequest.java +++ b/cloudfoundry-client/src/main/java/org/cloudfoundry/client/v3/deployments/_CreateDeploymentRequest.java @@ -36,6 +36,10 @@ abstract class _CreateDeploymentRequest { @Nullable abstract Relationship getDroplet(); + @JsonProperty("strategy") + @Nullable + abstract DeploymentStrategy getDeploymentStrategy(); + /** * The relationships */ diff --git a/cloudfoundry-client/src/test/java/org/cloudfoundry/client/v3/deployments/CreateDeploymentRequestTest.java b/cloudfoundry-client/src/test/java/org/cloudfoundry/client/v3/deployments/CreateDeploymentRequestTest.java index 12f0851760..8c4b3c3f64 100644 --- a/cloudfoundry-client/src/test/java/org/cloudfoundry/client/v3/deployments/CreateDeploymentRequestTest.java +++ b/cloudfoundry-client/src/test/java/org/cloudfoundry/client/v3/deployments/CreateDeploymentRequestTest.java @@ -61,4 +61,20 @@ void valid() { .build()) .build(); } + + @Test + void withDeploymentStrategy() { + CreateDeploymentRequest.builder() + .droplet(Relationship.builder().id("droplet-id").build()) + .deploymentStrategy(DeploymentStrategy.ROLLING) + .relationships( + DeploymentRelationships.builder() + .app( + ToOneRelationship.builder() + .data(Relationship.builder().id("app-id").build()) + .build()) + .build()) + .build(); + } + }