From e07d55b80f6fc287c3f70308f61bad75ab920019 Mon Sep 17 00:00:00 2001 From: spring-builds Date: Fri, 4 Apr 2025 13:09:28 +0000 Subject: [PATCH 1/3] Bumping versions --- docs/pom.xml | 2 +- pom.xml | 2 +- spring-cloud-config-client-tls-tests/pom.xml | 2 +- spring-cloud-config-client/pom.xml | 2 +- spring-cloud-config-dependencies/pom.xml | 2 +- spring-cloud-config-monitor/pom.xml | 2 +- spring-cloud-config-sample/pom.xml | 2 +- spring-cloud-config-server/pom.xml | 2 +- spring-cloud-starter-config/pom.xml | 4 ++-- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/pom.xml b/docs/pom.xml index 7ecb3cb9..83b54e30 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -8,7 +8,7 @@ org.springframework.cloud spring-cloud-config - 4.1.7-SNAPSHOT + 4.1.6-SNAPSHOT .. jar diff --git a/pom.xml b/pom.xml index 9bf995ca..c2f8e6b6 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 org.springframework.cloud spring-cloud-config - 4.1.7-SNAPSHOT + 4.1.6-SNAPSHOT pom Spring Cloud Config Spring Cloud Config diff --git a/spring-cloud-config-client-tls-tests/pom.xml b/spring-cloud-config-client-tls-tests/pom.xml index 72041f9c..2535365d 100644 --- a/spring-cloud-config-client-tls-tests/pom.xml +++ b/spring-cloud-config-client-tls-tests/pom.xml @@ -9,7 +9,7 @@ org.springframework.cloud spring-cloud-config - 4.1.7-SNAPSHOT + 4.1.6-SNAPSHOT .. diff --git a/spring-cloud-config-client/pom.xml b/spring-cloud-config-client/pom.xml index b8a1e2ed..a15fd695 100644 --- a/spring-cloud-config-client/pom.xml +++ b/spring-cloud-config-client/pom.xml @@ -10,7 +10,7 @@ org.springframework.cloud spring-cloud-config - 4.1.7-SNAPSHOT + 4.1.6-SNAPSHOT .. diff --git a/spring-cloud-config-dependencies/pom.xml b/spring-cloud-config-dependencies/pom.xml index 2a6fb165..9968ee09 100644 --- a/spring-cloud-config-dependencies/pom.xml +++ b/spring-cloud-config-dependencies/pom.xml @@ -10,7 +10,7 @@ spring-cloud-config-dependencies - 4.1.7-SNAPSHOT + 4.1.6-SNAPSHOT pom spring-cloud-config-dependencies Spring Cloud Config Dependencies diff --git a/spring-cloud-config-monitor/pom.xml b/spring-cloud-config-monitor/pom.xml index bde1bdaa..26ee2592 100644 --- a/spring-cloud-config-monitor/pom.xml +++ b/spring-cloud-config-monitor/pom.xml @@ -6,7 +6,7 @@ org.springframework.cloud spring-cloud-config - 4.1.7-SNAPSHOT + 4.1.6-SNAPSHOT .. spring-cloud-config-monitor diff --git a/spring-cloud-config-sample/pom.xml b/spring-cloud-config-sample/pom.xml index a6b2922b..68dec356 100644 --- a/spring-cloud-config-sample/pom.xml +++ b/spring-cloud-config-sample/pom.xml @@ -13,7 +13,7 @@ org.springframework.cloud spring-cloud-config - 4.1.7-SNAPSHOT + 4.1.6-SNAPSHOT .. diff --git a/spring-cloud-config-server/pom.xml b/spring-cloud-config-server/pom.xml index 38953a2e..db8efbdc 100644 --- a/spring-cloud-config-server/pom.xml +++ b/spring-cloud-config-server/pom.xml @@ -13,7 +13,7 @@ org.springframework.cloud spring-cloud-config - 4.1.7-SNAPSHOT + 4.1.6-SNAPSHOT .. diff --git a/spring-cloud-starter-config/pom.xml b/spring-cloud-starter-config/pom.xml index a36f354d..b17c900d 100644 --- a/spring-cloud-starter-config/pom.xml +++ b/spring-cloud-starter-config/pom.xml @@ -6,10 +6,10 @@ org.springframework.cloud spring-cloud-config - 4.1.7-SNAPSHOT + 4.1.6-SNAPSHOT spring-cloud-starter-config - 4.1.7-SNAPSHOT + 4.1.6-SNAPSHOT spring-cloud-starter-config Spring Cloud Starter https://projects.spring.io/spring-cloud From f9c8af5ce8264c146710935c67db0e33185ebaca Mon Sep 17 00:00:00 2001 From: spring-builds Date: Sat, 5 Apr 2025 13:07:36 +0000 Subject: [PATCH 2/3] Bumping versions --- docs/pom.xml | 2 +- pom.xml | 2 +- spring-cloud-config-client-tls-tests/pom.xml | 2 +- spring-cloud-config-client/pom.xml | 2 +- spring-cloud-config-dependencies/pom.xml | 2 +- spring-cloud-config-monitor/pom.xml | 2 +- spring-cloud-config-sample/pom.xml | 2 +- spring-cloud-config-server/pom.xml | 2 +- spring-cloud-starter-config/pom.xml | 4 ++-- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/pom.xml b/docs/pom.xml index 83b54e30..7ecb3cb9 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -8,7 +8,7 @@ org.springframework.cloud spring-cloud-config - 4.1.6-SNAPSHOT + 4.1.7-SNAPSHOT .. jar diff --git a/pom.xml b/pom.xml index c2f8e6b6..9bf995ca 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 org.springframework.cloud spring-cloud-config - 4.1.6-SNAPSHOT + 4.1.7-SNAPSHOT pom Spring Cloud Config Spring Cloud Config diff --git a/spring-cloud-config-client-tls-tests/pom.xml b/spring-cloud-config-client-tls-tests/pom.xml index 2535365d..72041f9c 100644 --- a/spring-cloud-config-client-tls-tests/pom.xml +++ b/spring-cloud-config-client-tls-tests/pom.xml @@ -9,7 +9,7 @@ org.springframework.cloud spring-cloud-config - 4.1.6-SNAPSHOT + 4.1.7-SNAPSHOT .. diff --git a/spring-cloud-config-client/pom.xml b/spring-cloud-config-client/pom.xml index a15fd695..b8a1e2ed 100644 --- a/spring-cloud-config-client/pom.xml +++ b/spring-cloud-config-client/pom.xml @@ -10,7 +10,7 @@ org.springframework.cloud spring-cloud-config - 4.1.6-SNAPSHOT + 4.1.7-SNAPSHOT .. diff --git a/spring-cloud-config-dependencies/pom.xml b/spring-cloud-config-dependencies/pom.xml index 9968ee09..2a6fb165 100644 --- a/spring-cloud-config-dependencies/pom.xml +++ b/spring-cloud-config-dependencies/pom.xml @@ -10,7 +10,7 @@ spring-cloud-config-dependencies - 4.1.6-SNAPSHOT + 4.1.7-SNAPSHOT pom spring-cloud-config-dependencies Spring Cloud Config Dependencies diff --git a/spring-cloud-config-monitor/pom.xml b/spring-cloud-config-monitor/pom.xml index 26ee2592..bde1bdaa 100644 --- a/spring-cloud-config-monitor/pom.xml +++ b/spring-cloud-config-monitor/pom.xml @@ -6,7 +6,7 @@ org.springframework.cloud spring-cloud-config - 4.1.6-SNAPSHOT + 4.1.7-SNAPSHOT .. spring-cloud-config-monitor diff --git a/spring-cloud-config-sample/pom.xml b/spring-cloud-config-sample/pom.xml index 68dec356..a6b2922b 100644 --- a/spring-cloud-config-sample/pom.xml +++ b/spring-cloud-config-sample/pom.xml @@ -13,7 +13,7 @@ org.springframework.cloud spring-cloud-config - 4.1.6-SNAPSHOT + 4.1.7-SNAPSHOT .. diff --git a/spring-cloud-config-server/pom.xml b/spring-cloud-config-server/pom.xml index db8efbdc..38953a2e 100644 --- a/spring-cloud-config-server/pom.xml +++ b/spring-cloud-config-server/pom.xml @@ -13,7 +13,7 @@ org.springframework.cloud spring-cloud-config - 4.1.6-SNAPSHOT + 4.1.7-SNAPSHOT .. diff --git a/spring-cloud-starter-config/pom.xml b/spring-cloud-starter-config/pom.xml index b17c900d..a36f354d 100644 --- a/spring-cloud-starter-config/pom.xml +++ b/spring-cloud-starter-config/pom.xml @@ -6,10 +6,10 @@ org.springframework.cloud spring-cloud-config - 4.1.6-SNAPSHOT + 4.1.7-SNAPSHOT spring-cloud-starter-config - 4.1.6-SNAPSHOT + 4.1.7-SNAPSHOT spring-cloud-starter-config Spring Cloud Starter https://projects.spring.io/spring-cloud From 9a9bbacb51d6c42b19c67728bc8d249faae5ca9a Mon Sep 17 00:00:00 2001 From: Ryan Baxter Date: Fri, 11 Apr 2025 09:25:40 -0400 Subject: [PATCH 3/3] Using Assert4J --- .../ConfigServerConfigDataLoaderTests.java | 62 +++++++++---------- 1 file changed, 30 insertions(+), 32 deletions(-) diff --git a/spring-cloud-config-client/src/test/java/org/springframework/cloud/config/client/ConfigServerConfigDataLoaderTests.java b/spring-cloud-config-client/src/test/java/org/springframework/cloud/config/client/ConfigServerConfigDataLoaderTests.java index bad39ef1..511c4c76 100644 --- a/spring-cloud-config-client/src/test/java/org/springframework/cloud/config/client/ConfigServerConfigDataLoaderTests.java +++ b/spring-cloud-config-client/src/test/java/org/springframework/cloud/config/client/ConfigServerConfigDataLoaderTests.java @@ -27,7 +27,7 @@ import java.util.Map; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.junit.jupiter.api.Assertions; +import org.assertj.core.api.ThrowableAssertAlternative; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; @@ -65,6 +65,7 @@ import org.springframework.web.client.RestTemplate; import static java.lang.String.format; import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.eq; @@ -199,10 +200,10 @@ public class ConfigServerConfigDataLoaderTests { RestTemplate restTemplate = new RestTemplate(requestFactory); properties.setFailFast(true); when(bootstrapContext.get(RestTemplate.class)).thenReturn(restTemplate); - ConfigClientFailFastException exception = Assertions.assertThrows(ConfigClientFailFastException.class, - () -> this.loader.load(context, resource)); - assertThat(exception.getCause()).isInstanceOf(HttpServerErrorException.class); - assertThat(exception.getMessage()).contains("fail fast property is set"); + assertThatExceptionOfType(ConfigClientFailFastException.class) + .isThrownBy(() -> this.loader.load(context, resource)) + .withMessageContaining("fail fast property is set") + .withCauseInstanceOf(HttpServerErrorException.class); } @Test @@ -213,20 +214,20 @@ public class ConfigServerConfigDataLoaderTests { properties.setFailFast(true); properties.setLabel("WeSetUpToReturn_NOT_FOUND_ForThisLabel"); when(bootstrapContext.get(RestTemplate.class)).thenReturn(restTemplate); - ConfigClientFailFastException exception = Assertions.assertThrows(ConfigClientFailFastException.class, - () -> this.loader.load(context, resource)); - assertThat(exception.getMessage()).contains( - "fail fast property is set, failing: None of labels [WeSetUpToReturn_NOT_FOUND_ForThisLabel] found"); + assertThatExceptionOfType(ConfigClientFailFastException.class) + .isThrownBy(() -> this.loader.load(context, resource)) + .withMessageContaining( + "fail fast property is set, failing: None of labels [WeSetUpToReturn_NOT_FOUND_ForThisLabel] found"); } @Test public void failFastWhenRequestTimesOut() { mockRequestTimedOut(); properties.setFailFast(true); - ConfigClientFailFastException exception = Assertions.assertThrows(ConfigClientFailFastException.class, - () -> this.loader.load(context, resource)); - assertThat(exception.getCause()).isExactlyInstanceOf(ResourceAccessException.class); - assertThat(exception.getMessage()).contains("fail fast property is set"); + assertThatExceptionOfType(ConfigClientFailFastException.class) + .isThrownBy(() -> this.loader.load(context, resource)) + .withMessageContaining("fail fast property is set") + .withCauseInstanceOf(ResourceAccessException.class); } @@ -239,10 +240,8 @@ public class ConfigServerConfigDataLoaderTests { properties.setUsername("username"); properties.setPassword("password"); properties.getHeaders().put(AUTHORIZATION, "Basic dXNlcm5hbWU6cGFzc3dvcmQNCg=="); - IllegalStateException exception = Assertions.assertThrows(IllegalStateException.class, - () -> this.loader.load(context, resource)); - assertThat(exception.getMessage()) - .contains("Could not locate PropertySource and the fail fast property is set, failing"); + assertThatExceptionOfType(IllegalStateException.class).isThrownBy(() -> this.loader.load(context, resource)) + .withMessageContaining("Could not locate PropertySource and the fail fast property is set, failing"); } @Test @@ -282,26 +281,24 @@ public class ConfigServerConfigDataLoaderTests { properties.getHeaders().put(AUTHORIZATION, "Basic dXNlcm5hbWU6cGFzc3dvcmQNCg=="); String username = "user"; String password = "pass"; - IllegalStateException exception = Assertions.assertThrows(IllegalStateException.class, - () -> factory(properties).addAuthorizationToken(headers, username, password)); - assertThat(exception.getMessage()).contains("You must set either 'password' or 'authorization'"); + assertThatExceptionOfType(IllegalStateException.class) + .isThrownBy(() -> factory(properties).addAuthorizationToken(headers, username, password)) + .withMessageContaining("You must set either 'password' or 'authorization'"); } @Test public void shouldThrowExceptionWhenNegativeReadTimeoutSet() { properties.setRequestReadTimeout(-1); - IllegalStateException exception = Assertions.assertThrows(IllegalStateException.class, - () -> factory(properties).create()); - assertThat(exception.getMessage()).contains("Invalid Value for Read Timeout set."); + assertThatExceptionOfType(IllegalStateException.class).isThrownBy(() -> factory(properties).create()) + .withMessageContaining("Invalid Value for Read Timeout set."); } @Test public void shouldThrowExceptionWhenNegativeConnectTimeoutSet() { properties.setRequestConnectTimeout(-1); - IllegalStateException exception = Assertions.assertThrows(IllegalStateException.class, - () -> factory(properties).create()); - assertThat(exception.getMessage()).contains("Invalid Value for Connect Timeout set."); + assertThatExceptionOfType(IllegalStateException.class).isThrownBy(() -> factory(properties).create()) + .withMessageContaining("Invalid Value for Connect Timeout set."); } @Test @@ -376,8 +373,8 @@ public class ConfigServerConfigDataLoaderTests { // is never tried, due to the strategy. assertNextUriIsNotTried(true, ConfigClientProperties.MultipleUriStrategy.CONNECTION_TIMEOUT_ONLY, HttpStatus.TEMPORARY_REDIRECT, null // IllegalStateException has no cause, - // because getRemoteEnvironment did - // not throw an exception + // because getRemoteEnvironment did + // not throw an exception ); } @@ -708,12 +705,13 @@ public class ConfigServerConfigDataLoaderTests { mockRequestResponse(requestFactory, goodURI, HttpStatus.OK); when(bootstrapContext.get(RestTemplate.class)).thenReturn(restTemplate); - ConfigClientFailFastException exception = Assertions.assertThrows(ConfigClientFailFastException.class, - () -> this.loader.load(context, resource)); + ThrowableAssertAlternative throwableAssertAlternative = assertThatExceptionOfType( + ConfigClientFailFastException.class) + .isThrownBy(() -> this.loader.load(context, resource)) + .withMessageContaining("fail fast property is set"); if (expectedCause != null) { - assertThat(exception.getCause()).isInstanceOf(expectedCause); + throwableAssertAlternative.withCauseInstanceOf(expectedCause); } - assertThat(exception.getMessage()).contains("fail fast property is set"); } @SuppressWarnings("SameParameterValue")