From 4571f8d50641ac8549c973911a14c3dc34285823 Mon Sep 17 00:00:00 2001 From: Glenn Renfro Date: Wed, 30 Oct 2024 17:15:13 -0400 Subject: [PATCH] Remove deprecated DockerComposeRule.waitingForService method Replace the usage of this deprecated method with the waitingForService(String serviceName, HealthCheck healthCheck, ReadableDuration timeout) method. resolves issue #6013 Signed-off-by: Glenn Renfro --- .../common/test/docker/junit5/DockerComposeManager.java | 4 ++-- .../common/test/docker/compose/DockerComposeRule.java | 5 ----- whats-new.adoc | 1 + 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/spring-cloud-dataflow-common/spring-cloud-dataflow-common-test-docker-junit5/src/main/java/org/springframework/cloud/dataflow/common/test/docker/junit5/DockerComposeManager.java b/spring-cloud-dataflow-common/spring-cloud-dataflow-common-test-docker-junit5/src/main/java/org/springframework/cloud/dataflow/common/test/docker/junit5/DockerComposeManager.java index 4f74914c5f..1afc75d1e8 100644 --- a/spring-cloud-dataflow-common/spring-cloud-dataflow-common-test-docker-junit5/src/main/java/org/springframework/cloud/dataflow/common/test/docker/junit5/DockerComposeManager.java +++ b/spring-cloud-dataflow-common/spring-cloud-dataflow-common-test-docker-junit5/src/main/java/org/springframework/cloud/dataflow/common/test/docker/junit5/DockerComposeManager.java @@ -98,7 +98,7 @@ public void build(String classKey, String methodKey) { Builder builder = DockerComposeRule.builder(); builder.files(DockerComposeFiles.from(locations.toArray(new String[0]))); for (String service : services) { - builder.waitingForService(service, toHaveAllPortsOpen()); + builder.waitingForService(service, toHaveAllPortsOpen(), DockerComposeRule.DEFAULT_TIMEOUT); } builder.saveLogsTo("build/test-docker-logs/" + log + classKey + "-" + methodKey); DockerComposeRule rule = builder.build(); @@ -132,7 +132,7 @@ public void build(String classKey, String methodKey) { Builder builder = DockerComposeRule.builder(); builder.files(DockerComposeFiles.from(locations.toArray(new String[0]))); for (String service : services) { - builder.waitingForService(service, toHaveAllPortsOpen()); + builder.waitingForService(service, toHaveAllPortsOpen(), DockerComposeRule.DEFAULT_TIMEOUT); } builder.saveLogsTo("build/test-docker-logs/" + log + classKey + "-" + methodKey); DockerComposeRule rule = builder.build(); diff --git a/spring-cloud-dataflow-common/spring-cloud-dataflow-common-test-docker/src/main/java/org/springframework/cloud/dataflow/common/test/docker/compose/DockerComposeRule.java b/spring-cloud-dataflow-common/spring-cloud-dataflow-common-test-docker/src/main/java/org/springframework/cloud/dataflow/common/test/docker/compose/DockerComposeRule.java index 2c6674d9f6..448a116b06 100644 --- a/spring-cloud-dataflow-common/spring-cloud-dataflow-common-test-docker/src/main/java/org/springframework/cloud/dataflow/common/test/docker/compose/DockerComposeRule.java +++ b/spring-cloud-dataflow-common/spring-cloud-dataflow-common-test-docker/src/main/java/org/springframework/cloud/dataflow/common/test/docker/compose/DockerComposeRule.java @@ -236,11 +236,6 @@ public T logCollector(LogCollector logCollector) { return self(); } - @Deprecated - public T waitingForService(String serviceName, HealthCheck healthCheck) { - return waitingForService(serviceName, healthCheck, DEFAULT_TIMEOUT); - } - public T waitingForService(String serviceName, HealthCheck healthCheck, ReadableDuration timeout) { ClusterHealthCheck clusterHealthCheck = serviceHealthCheck(serviceName, healthCheck); return addClusterWait(new ClusterWait(clusterHealthCheck, timeout)); diff --git a/whats-new.adoc b/whats-new.adoc index 0793877f12..c8d6fc1ba0 100644 --- a/whats-new.adoc +++ b/whats-new.adoc @@ -37,6 +37,7 @@ VersionInfoProperties versionInfoProperties, SecurityStateBean securityStateBean ** getStepNamesForJob * The following deprecated `Converters` have been removed from SCDF: `AbstractDateTimeConverter`, `DateToStringConverter`, and `StringToDateConverter`. Use the converters provided by Spring Batch. * `findByTaskNameContainsAndDslTextContains` deprecated method has been removed from `TaskDefinitionRepository`. +* `DockerComposeRule.waitingForService(String serviceName, HealthCheck healthCheck)` has been replaced by `DockerComposeRule.waitingForService(String serviceName, HealthCheck healthCheck, ReadableDuration timeout)`. === Breaking Changes Announce deprecated changes here