Clean up warnings

This commit is contained in:
Sam Brannen
2025-01-03 17:42:57 +02:00
parent 087641c508
commit e26c161ae9
5 changed files with 14 additions and 7 deletions

View File

@@ -54,6 +54,7 @@ class HttpEntityTests {
MultiValueMap<String, String> map = new LinkedMultiValueMap<>();
map.set("Content-Type", "text/plain");
String body = "foo";
@SuppressWarnings("deprecation")
HttpEntity<String> entity = new HttpEntity<>(body, map);
assertThat(entity.getBody()).isEqualTo(body);
assertThat(entity.getHeaders().getContentType()).isEqualTo(MediaType.TEXT_PLAIN);

View File

@@ -123,6 +123,7 @@ class HeadersAdaptersTests {
}
@ParameterizedPopulatedHeadersTest
@SuppressWarnings("deprecation")
void copyUsingEntrySetPutRemovesDuplicates(MultiValueMap<String, String> headers) {
HttpHeaders headers2 = new HttpHeaders();
for (Map.Entry<String, List<String>> entry : headers.entrySet()) {
@@ -141,6 +142,7 @@ class HeadersAdaptersTests {
}
@ParameterizedPopulatedHeadersTest
@SuppressWarnings("deprecation")
void copyUsingPutAllRemovesDuplicates(MultiValueMap<String, String> headers) {
HttpHeaders headers2 = new HttpHeaders();
headers2.putAll(headers);

View File

@@ -33,6 +33,7 @@ import static org.assertj.core.api.Assertions.assertThat;
class ErrorResponseTests {
@Test
@SuppressWarnings("deprecation")
void createWithHttpHeader() {
ErrorResponse response = ErrorResponse.builder(new IllegalStateException(), HttpStatus.BAD_REQUEST, "test")
.header("header", "value").build();
@@ -40,6 +41,7 @@ class ErrorResponseTests {
}
@Test
@SuppressWarnings("deprecation")
void createWithHttpHeadersConsumer() {
ErrorResponse response = ErrorResponse.builder(new IllegalStateException(), HttpStatus.BAD_REQUEST, "test")
.header("header", "value")