Suppress warnings
This commit is contained in:
@@ -72,6 +72,7 @@ class SimpleUrlHandlerMappingIntegrationTests extends AbstractHttpHandlerIntegra
|
||||
|
||||
URI url = new URI("http://localhost:" + this.port + "/foo");
|
||||
RequestEntity<Void> request = RequestEntity.get(url).build();
|
||||
@SuppressWarnings("resource")
|
||||
ResponseEntity<byte[]> response = new RestTemplate().exchange(request, byte[].class);
|
||||
|
||||
assertThat(response.getStatusCode()).isEqualTo(HttpStatus.OK);
|
||||
@@ -84,6 +85,7 @@ class SimpleUrlHandlerMappingIntegrationTests extends AbstractHttpHandlerIntegra
|
||||
|
||||
URI url = new URI("http://localhost:" + this.port + "/bar");
|
||||
RequestEntity<Void> request = RequestEntity.get(url).build();
|
||||
@SuppressWarnings("resource")
|
||||
ResponseEntity<byte[]> response = new RestTemplate().exchange(request, byte[].class);
|
||||
|
||||
assertThat(response.getStatusCode()).isEqualTo(HttpStatus.OK);
|
||||
@@ -96,6 +98,7 @@ class SimpleUrlHandlerMappingIntegrationTests extends AbstractHttpHandlerIntegra
|
||||
|
||||
URI url = new URI("http://localhost:" + this.port + "/header");
|
||||
RequestEntity<Void> request = RequestEntity.get(url).build();
|
||||
@SuppressWarnings("resource")
|
||||
ResponseEntity<byte[]> response = new RestTemplate().exchange(request, byte[].class);
|
||||
|
||||
assertThat(response.getStatusCode()).isEqualTo(HttpStatus.OK);
|
||||
@@ -103,6 +106,7 @@ class SimpleUrlHandlerMappingIntegrationTests extends AbstractHttpHandlerIntegra
|
||||
}
|
||||
|
||||
@ParameterizedHttpServerTest
|
||||
@SuppressWarnings("resource")
|
||||
void handlerNotFound(HttpServer httpServer) throws Exception {
|
||||
startServer(httpServer);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -55,6 +55,7 @@ class ContextPathIntegrationTests {
|
||||
server.start();
|
||||
|
||||
try {
|
||||
@SuppressWarnings("resource")
|
||||
RestTemplate restTemplate = new RestTemplate();
|
||||
String actual;
|
||||
|
||||
@@ -87,6 +88,7 @@ class ContextPathIntegrationTests {
|
||||
|
||||
try {
|
||||
String url = "http://localhost:" + server.getPort() + "/app/api/test";
|
||||
@SuppressWarnings("resource")
|
||||
String actual = new RestTemplate().getForObject(url, String.class);
|
||||
assertThat(actual).isEqualTo("Tested in /app/api");
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -94,6 +94,7 @@ class RequestMappingViewResolutionIntegrationTests extends AbstractRequestMappin
|
||||
|
||||
URI uri = new URI("http://localhost:" + this.port + "/redirect");
|
||||
RequestEntity<Void> request = RequestEntity.get(uri).accept(MediaType.ALL).build();
|
||||
@SuppressWarnings("resource")
|
||||
ResponseEntity<Void> response = new RestTemplate(factory).exchange(request, Void.class);
|
||||
|
||||
assertThat(response.getStatusCode()).isEqualTo(HttpStatus.SEE_OTHER);
|
||||
|
||||
Reference in New Issue
Block a user