diff --git a/.java-version b/.java-version new file mode 100644 index 00000000..98d9bcb7 --- /dev/null +++ b/.java-version @@ -0,0 +1 @@ +17 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 85b6f1aa..9b140b5e 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 @@ -503,7 +503,7 @@ public class ConfigServerConfigDataLoaderTests { HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.APPLICATION_JSON); when(response.getHeaders()).thenReturn(headers); - when(response.getRawStatusCode()).thenReturn(status.value()); + when(response.getStatusCode()).thenReturn(status); when(response.getBody()).thenReturn(new ByteArrayInputStream("{}".getBytes())); } diff --git a/spring-cloud-config-client/src/test/java/org/springframework/cloud/config/client/ConfigServicePropertySourceLocatorTests.java b/spring-cloud-config-client/src/test/java/org/springframework/cloud/config/client/ConfigServicePropertySourceLocatorTests.java index 6148f4c7..3fb1838b 100644 --- a/spring-cloud-config-client/src/test/java/org/springframework/cloud/config/client/ConfigServicePropertySourceLocatorTests.java +++ b/spring-cloud-config-client/src/test/java/org/springframework/cloud/config/client/ConfigServicePropertySourceLocatorTests.java @@ -558,7 +558,7 @@ public class ConfigServicePropertySourceLocatorTests { HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.APPLICATION_JSON); Mockito.when(response.getHeaders()).thenReturn(headers); - Mockito.when(response.getRawStatusCode()).thenReturn(status.value()); + Mockito.when(response.getStatusCode()).thenReturn(status); Mockito.when(response.getBody()).thenReturn(new ByteArrayInputStream("{}".getBytes())); } diff --git a/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/environment/VaultKvAccessStrategySupport.java b/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/environment/VaultKvAccessStrategySupport.java index 4e7b6f34..4356b2da 100644 --- a/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/environment/VaultKvAccessStrategySupport.java +++ b/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/environment/VaultKvAccessStrategySupport.java @@ -20,6 +20,7 @@ import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; import org.springframework.http.HttpStatus; +import org.springframework.http.HttpStatusCode; import org.springframework.http.ResponseEntity; import org.springframework.web.client.HttpStatusCodeException; import org.springframework.web.client.RestOperations; @@ -70,7 +71,7 @@ abstract class VaultKvAccessStrategySupport implements VaultKvAccessStrategy { ResponseEntity response = this.rest.exchange(urlTemplate, HttpMethod.GET, new HttpEntity<>(headers), VaultResponse.class, key); - HttpStatus status = response.getStatusCode(); + HttpStatusCode status = response.getStatusCode(); if (status == HttpStatus.OK) { return extractDataFromBody(response.getBody()); }