Changes for 5.0.0 release

This commit is contained in:
Ryan Baxter
2025-06-06 16:19:39 -04:00
parent 0b2b4fa079
commit c90d9f5d6d
28 changed files with 110 additions and 72 deletions

View File

@@ -10,7 +10,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config</artifactId>
<version>4.3.1-SNAPSHOT</version>
<version>5.0.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>

View File

@@ -124,8 +124,8 @@ public class ConfigServerConfigDataResource extends ConfigDataResource {
private boolean uriEqual(String thisUriString, String thatUriString) {
try {
UriComponents thisUri = UriComponentsBuilder.fromHttpUrl(thisUriString).build();
UriComponents thatUri = UriComponentsBuilder.fromHttpUrl(thatUriString).build();
UriComponents thisUri = UriComponentsBuilder.fromUriString(thisUriString).build();
UriComponents thatUri = UriComponentsBuilder.fromUriString(thatUriString).build();
return Objects.equals(thisUri.getHost(), thatUri.getHost())
&& Objects.equals(thisUri.getPort(), thatUri.getPort())
&& Objects.equals(thisUri.getPath(), thatUri.getPath());
@@ -138,7 +138,7 @@ public class ConfigServerConfigDataResource extends ConfigDataResource {
private int urisHashCode(String[] uris) {
return Arrays.stream(uris).mapToInt(uriString -> {
try {
UriComponents uriComponents = UriComponentsBuilder.fromHttpUrl(uriString).build();
UriComponents uriComponents = UriComponentsBuilder.fromUriString(uriString).build();
return Objects.hash(uriComponents.getHost(), uriComponents.getPath(), uriComponents.getPort());
}
catch (Exception e) {

View File

@@ -263,7 +263,7 @@ public class ConfigServerConfigDataLoaderTests {
String username = "user";
String password = "pass";
factory(properties).addAuthorizationToken(headers, username, password);
assertThat(headers).hasSize(1);
assertThat(headers.size()).isEqualTo(1);
}
@Test
@@ -272,7 +272,7 @@ public class ConfigServerConfigDataLoaderTests {
properties.getHeaders().put(AUTHORIZATION, "Basic dXNlcm5hbWU6cGFzc3dvcmQNCg==");
String username = "user";
factory(properties).addAuthorizationToken(headers, username, null);
assertThat(headers).hasSize(1);
assertThat(headers.size()).isEqualTo(1);
}
@Test

View File

@@ -23,7 +23,6 @@ import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.ArgumentCaptor;
import org.springframework.beans.factory.support.InstanceSupplier;
import org.springframework.boot.BootstrapRegistry;
import org.springframework.boot.ConfigurableBootstrapContext;
import org.springframework.boot.context.config.ConfigDataLocation;

View File

@@ -254,7 +254,7 @@ public class ConfigServicePropertySourceLocatorTests {
String username = "user";
String password = "pass";
factory(defaults).addAuthorizationToken(headers, username, password);
assertThat(headers).hasSize(1);
assertThat(headers.size()).isEqualTo(1);
}
@Test
@@ -265,7 +265,7 @@ public class ConfigServicePropertySourceLocatorTests {
String username = "user";
String password = null;
factory(defaults).addAuthorizationToken(headers, username, password);
assertThat(headers).hasSize(1);
assertThat(headers.size()).isEqualTo(1);
}
@Test