From ac0f15bb1d8340b1420b7a75e5f47452cf9683e6 Mon Sep 17 00:00:00 2001 From: Georg Lokowandt Date: Thu, 5 Sep 2024 16:27:39 +0200 Subject: [PATCH] minor refactoring to allow import to Eclipse --- .../ReactorServiceInstancesV3Test.java | 0 .../_DeleteServiceInstanceResponse.java | 3 +- .../client/v3/PaginatedRequest.java | 2 +- .../_ListIdentityZonesResponse.java | 4 +++ .../applications/DefaultApplications.java | 32 ++++++++++++------- .../logcachetest/package-info.java | 2 ++ .../binding/_UnbindResponse.java | 2 ++ .../instance/_DeprovisionSyncResponse.java | 2 ++ .../instance/_UpdateSyncResponse.java | 2 ++ .../_LastOperationDeprovisionResponse.java | 2 ++ .../servicebroker/package-info.java | 2 ++ 11 files changed, 38 insertions(+), 15 deletions(-) rename cloudfoundry-client-reactor/src/test/java/org/cloudfoundry/reactor/client/v3/{serviceInstances => serviceinstances}/ReactorServiceInstancesV3Test.java (100%) diff --git a/cloudfoundry-client-reactor/src/test/java/org/cloudfoundry/reactor/client/v3/serviceInstances/ReactorServiceInstancesV3Test.java b/cloudfoundry-client-reactor/src/test/java/org/cloudfoundry/reactor/client/v3/serviceinstances/ReactorServiceInstancesV3Test.java similarity index 100% rename from cloudfoundry-client-reactor/src/test/java/org/cloudfoundry/reactor/client/v3/serviceInstances/ReactorServiceInstancesV3Test.java rename to cloudfoundry-client-reactor/src/test/java/org/cloudfoundry/reactor/client/v3/serviceinstances/ReactorServiceInstancesV3Test.java diff --git a/cloudfoundry-client/src/main/java/org/cloudfoundry/client/v2/serviceinstances/_DeleteServiceInstanceResponse.java b/cloudfoundry-client/src/main/java/org/cloudfoundry/client/v2/serviceinstances/_DeleteServiceInstanceResponse.java index 4876f4f3a4..301853f570 100644 --- a/cloudfoundry-client/src/main/java/org/cloudfoundry/client/v2/serviceinstances/_DeleteServiceInstanceResponse.java +++ b/cloudfoundry-client/src/main/java/org/cloudfoundry/client/v2/serviceinstances/_DeleteServiceInstanceResponse.java @@ -25,7 +25,6 @@ import com.fasterxml.jackson.databind.jsontype.impl.TypeIdResolverBase; import org.cloudfoundry.Nullable; import org.cloudfoundry.client.v2.Resource; -import org.cloudfoundry.client.v2.jobs.JobEntity; import org.immutables.value.Value; /** @@ -40,7 +39,7 @@ abstract class _DeleteServiceInstanceResponse extends Resource { */ @JsonProperty("entity") @JsonTypeIdResolver(_DeleteServiceInstanceResponse.DeleteServiceInstanceResponseTypeIdResolver.class) - @JsonTypeInfo(use = JsonTypeInfo.Id.CUSTOM, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", defaultImpl = JobEntity.class, visible = true) + @JsonTypeInfo(use = JsonTypeInfo.Id.CUSTOM, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", defaultImpl = org.cloudfoundry.client.v2.jobs.JobEntity.class, visible = true) @Nullable public abstract Object getEntity(); diff --git a/cloudfoundry-client/src/main/java/org/cloudfoundry/client/v3/PaginatedRequest.java b/cloudfoundry-client/src/main/java/org/cloudfoundry/client/v3/PaginatedRequest.java index 2e1f9e61cd..514b90ef7e 100644 --- a/cloudfoundry-client/src/main/java/org/cloudfoundry/client/v3/PaginatedRequest.java +++ b/cloudfoundry-client/src/main/java/org/cloudfoundry/client/v3/PaginatedRequest.java @@ -47,7 +47,7 @@ public abstract class PaginatedRequest { public abstract Integer getPerPage(); @Value.Check - void check() { + public void check() { if (getPage() != null && getPage() < 1) { throw new IllegalStateException("page must be greater than or equal to 1"); } diff --git a/cloudfoundry-client/src/main/java/org/cloudfoundry/uaa/identityzones/_ListIdentityZonesResponse.java b/cloudfoundry-client/src/main/java/org/cloudfoundry/uaa/identityzones/_ListIdentityZonesResponse.java index 873faa32b3..905de04309 100644 --- a/cloudfoundry-client/src/main/java/org/cloudfoundry/uaa/identityzones/_ListIdentityZonesResponse.java +++ b/cloudfoundry-client/src/main/java/org/cloudfoundry/uaa/identityzones/_ListIdentityZonesResponse.java @@ -17,11 +17,14 @@ package org.cloudfoundry.uaa.identityzones; +import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.deser.std.StdDeserializer; + +import org.cloudfoundry.Nullable; import org.immutables.value.Value; import java.io.IOException; @@ -34,6 +37,7 @@ @Value.Immutable abstract class _ListIdentityZonesResponse { + /** * The identity zones */ diff --git a/cloudfoundry-operations/src/main/java/org/cloudfoundry/operations/applications/DefaultApplications.java b/cloudfoundry-operations/src/main/java/org/cloudfoundry/operations/applications/DefaultApplications.java index 03ddf9527c..a41368edca 100644 --- a/cloudfoundry-operations/src/main/java/org/cloudfoundry/operations/applications/DefaultApplications.java +++ b/cloudfoundry-operations/src/main/java/org/cloudfoundry/operations/applications/DefaultApplications.java @@ -693,18 +693,11 @@ public Mono pushManifestV3(PushManifestV3Request request) { .flatMap( function( (appId, packageId) -> - buildAndStage( - cloudFoundryClient, - manifestApp, - packageId) - .flatMap( - dropletId -> - applyDropletAndWaitForRunning( - cloudFoundryClient, - manifestApp - .getName(), - appId, - dropletId)))))) + buildAndStageAndWaitForRunning( + cloudFoundryClient, + manifestApp, + packageId, + appId))))) .then(); } @@ -1157,6 +1150,21 @@ private static Mono bindServices( .then(); } + private static Mono buildAndStageAndWaitForRunning( + CloudFoundryClient cloudFoundryClient, + ManifestV3Application manifestApp, + String packageId, + String appId) { + return buildAndStage(cloudFoundryClient, manifestApp, packageId) + .flatMap( + dropletId -> + applyDropletAndWaitForRunning( + cloudFoundryClient, + manifestApp.getName(), + appId, + dropletId)); + } + private static Mono buildAndStage( CloudFoundryClient cloudFoundryClient, ManifestV3Application manifestApp, diff --git a/test-log-cache/src/main/java/org/cloudfoundry/logcachetest/package-info.java b/test-log-cache/src/main/java/org/cloudfoundry/logcachetest/package-info.java index 440918b866..d1daa10d1d 100644 --- a/test-log-cache/src/main/java/org/cloudfoundry/logcachetest/package-info.java +++ b/test-log-cache/src/main/java/org/cloudfoundry/logcachetest/package-info.java @@ -24,3 +24,5 @@ typeImmutable = "*" ) package org.cloudfoundry.logcachetest; + +import org.immutables.value.Value; diff --git a/test-service-broker/src/main/java/org/cloudfoundry/servicebroker/binding/_UnbindResponse.java b/test-service-broker/src/main/java/org/cloudfoundry/servicebroker/binding/_UnbindResponse.java index 4379da6be3..044653808f 100644 --- a/test-service-broker/src/main/java/org/cloudfoundry/servicebroker/binding/_UnbindResponse.java +++ b/test-service-broker/src/main/java/org/cloudfoundry/servicebroker/binding/_UnbindResponse.java @@ -16,6 +16,8 @@ package org.cloudfoundry.servicebroker.binding; +import org.immutables.value.Value; + @Value.Immutable abstract class _UnbindResponse { diff --git a/test-service-broker/src/main/java/org/cloudfoundry/servicebroker/instance/_DeprovisionSyncResponse.java b/test-service-broker/src/main/java/org/cloudfoundry/servicebroker/instance/_DeprovisionSyncResponse.java index cb078134a4..a4ec3c5f22 100644 --- a/test-service-broker/src/main/java/org/cloudfoundry/servicebroker/instance/_DeprovisionSyncResponse.java +++ b/test-service-broker/src/main/java/org/cloudfoundry/servicebroker/instance/_DeprovisionSyncResponse.java @@ -16,6 +16,8 @@ package org.cloudfoundry.servicebroker.instance; +import org.immutables.value.Value; + @Value.Immutable abstract class _DeprovisionSyncResponse { diff --git a/test-service-broker/src/main/java/org/cloudfoundry/servicebroker/instance/_UpdateSyncResponse.java b/test-service-broker/src/main/java/org/cloudfoundry/servicebroker/instance/_UpdateSyncResponse.java index b33cce5ef2..e288a0a6df 100644 --- a/test-service-broker/src/main/java/org/cloudfoundry/servicebroker/instance/_UpdateSyncResponse.java +++ b/test-service-broker/src/main/java/org/cloudfoundry/servicebroker/instance/_UpdateSyncResponse.java @@ -16,6 +16,8 @@ package org.cloudfoundry.servicebroker.instance; +import org.immutables.value.Value; + @Value.Immutable abstract class _UpdateSyncResponse { diff --git a/test-service-broker/src/main/java/org/cloudfoundry/servicebroker/lastoperation/_LastOperationDeprovisionResponse.java b/test-service-broker/src/main/java/org/cloudfoundry/servicebroker/lastoperation/_LastOperationDeprovisionResponse.java index 2492975420..ff669bcdb1 100644 --- a/test-service-broker/src/main/java/org/cloudfoundry/servicebroker/lastoperation/_LastOperationDeprovisionResponse.java +++ b/test-service-broker/src/main/java/org/cloudfoundry/servicebroker/lastoperation/_LastOperationDeprovisionResponse.java @@ -16,6 +16,8 @@ package org.cloudfoundry.servicebroker.lastoperation; +import org.immutables.value.Value; + @Value.Immutable abstract class _LastOperationDeprovisionResponse { diff --git a/test-service-broker/src/main/java/org/cloudfoundry/servicebroker/package-info.java b/test-service-broker/src/main/java/org/cloudfoundry/servicebroker/package-info.java index 217d28ba61..cd1e62f229 100644 --- a/test-service-broker/src/main/java/org/cloudfoundry/servicebroker/package-info.java +++ b/test-service-broker/src/main/java/org/cloudfoundry/servicebroker/package-info.java @@ -28,3 +28,5 @@ typeImmutable = "*" ) package org.cloudfoundry.servicebroker; + +import org.immutables.value.Value;