Browse Source

Suppress deprecation warnings

pull/22938/head
Sam Brannen 7 years ago
parent
commit
e465f51d56
  1. 1
      spring-web/src/test/java/org/springframework/http/client/Netty4ClientHttpRequestFactoryTests.java
  2. 1
      spring-web/src/test/java/org/springframework/http/client/support/BasicAuthorizationInterceptorTests.java
  3. 1
      spring-web/src/test/java/org/springframework/remoting/caucho/CauchoRemotingTests.java
  4. 10
      spring-web/src/test/java/org/springframework/web/client/AsyncRestTemplateIntegrationTests.java
  5. 3
      spring-web/src/test/java/org/springframework/web/client/RestTemplateIntegrationTests.java
  6. 7
      spring-web/src/test/java/org/springframework/web/cors/reactive/CorsUtilsTests.java
  7. 1
      spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/support/DefaultHandlerExceptionResolverTests.java

1
spring-web/src/test/java/org/springframework/http/client/Netty4ClientHttpRequestFactoryTests.java

@ -43,6 +43,7 @@ public class Netty4ClientHttpRequestFactoryTests extends AbstractHttpRequestFact @@ -43,6 +43,7 @@ public class Netty4ClientHttpRequestFactoryTests extends AbstractHttpRequestFact
}
@Override
@SuppressWarnings("deprecation")
protected ClientHttpRequestFactory createRequestFactory() {
return new Netty4ClientHttpRequestFactory(eventLoopGroup);
}

1
spring-web/src/test/java/org/springframework/http/client/support/BasicAuthorizationInterceptorTests.java

@ -37,6 +37,7 @@ import static org.mockito.Mockito.verify; @@ -37,6 +37,7 @@ import static org.mockito.Mockito.verify;
* @author Phillip Webb
* @author Stephane Nicoll
*/
@SuppressWarnings("deprecation")
public class BasicAuthorizationInterceptorTests {
@Test

1
spring-web/src/test/java/org/springframework/remoting/caucho/CauchoRemotingTests.java

@ -105,6 +105,7 @@ public class CauchoRemotingTests { @@ -105,6 +105,7 @@ public class CauchoRemotingTests {
}
@Test
@SuppressWarnings("deprecation")
public void simpleHessianServiceExporter() throws IOException {
final int port = SocketUtils.findAvailableTcpPort();

10
spring-web/src/test/java/org/springframework/web/client/AsyncRestTemplateIntegrationTests.java

@ -39,10 +39,7 @@ import org.springframework.http.HttpRequest; @@ -39,10 +39,7 @@ import org.springframework.http.HttpRequest;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.http.client.AsyncClientHttpRequestExecution;
import org.springframework.http.client.AsyncClientHttpRequestInterceptor;
import org.springframework.http.client.ClientHttpResponse;
import org.springframework.http.client.HttpComponentsAsyncClientHttpRequestFactory;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.util.concurrent.ListenableFuture;
@ -65,7 +62,7 @@ import static org.junit.Assert.fail; @@ -65,7 +62,7 @@ import static org.junit.Assert.fail;
public class AsyncRestTemplateIntegrationTests extends AbstractMockWebServerTestCase {
private final AsyncRestTemplate template = new AsyncRestTemplate(
new HttpComponentsAsyncClientHttpRequestFactory());
new org.springframework.http.client.HttpComponentsAsyncClientHttpRequestFactory());
@Test
@ -637,7 +634,7 @@ public class AsyncRestTemplateIntegrationTests extends AbstractMockWebServerTest @@ -637,7 +634,7 @@ public class AsyncRestTemplateIntegrationTests extends AbstractMockWebServerTest
}
private static class RequestInterceptor implements AsyncClientHttpRequestInterceptor {
private static class RequestInterceptor implements org.springframework.http.client.AsyncClientHttpRequestInterceptor {
private final CountDownLatch latch = new CountDownLatch(1);
@ -647,7 +644,7 @@ public class AsyncRestTemplateIntegrationTests extends AbstractMockWebServerTest @@ -647,7 +644,7 @@ public class AsyncRestTemplateIntegrationTests extends AbstractMockWebServerTest
@Override
public ListenableFuture<ClientHttpResponse> intercept(HttpRequest request, byte[] body,
AsyncClientHttpRequestExecution execution) throws IOException {
org.springframework.http.client.AsyncClientHttpRequestExecution execution) throws IOException {
ListenableFuture<ClientHttpResponse> future = execution.executeAsync(request, body);
future.addCallback(
@ -662,4 +659,5 @@ public class AsyncRestTemplateIntegrationTests extends AbstractMockWebServerTest @@ -662,4 +659,5 @@ public class AsyncRestTemplateIntegrationTests extends AbstractMockWebServerTest
return future;
}
}
}

3
spring-web/src/test/java/org/springframework/web/client/RestTemplateIntegrationTests.java

@ -48,7 +48,6 @@ import org.springframework.http.RequestEntity; @@ -48,7 +48,6 @@ import org.springframework.http.RequestEntity;
import org.springframework.http.ResponseEntity;
import org.springframework.http.client.ClientHttpRequestFactory;
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
import org.springframework.http.client.Netty4ClientHttpRequestFactory;
import org.springframework.http.client.OkHttp3ClientHttpRequestFactory;
import org.springframework.http.client.SimpleClientHttpRequestFactory;
import org.springframework.http.converter.json.MappingJacksonValue;
@ -83,7 +82,7 @@ public class RestTemplateIntegrationTests extends AbstractMockWebServerTestCase @@ -83,7 +82,7 @@ public class RestTemplateIntegrationTests extends AbstractMockWebServerTestCase
return Arrays.asList(
new SimpleClientHttpRequestFactory(),
new HttpComponentsClientHttpRequestFactory(),
new Netty4ClientHttpRequestFactory(),
new org.springframework.http.client.Netty4ClientHttpRequestFactory(),
new OkHttp3ClientHttpRequestFactory()
);
}

7
spring-web/src/test/java/org/springframework/web/cors/reactive/CorsUtilsTests.java

@ -25,7 +25,6 @@ import org.springframework.http.HttpHeaders; @@ -25,7 +25,6 @@ import org.springframework.http.HttpHeaders;
import org.springframework.http.server.reactive.ServerHttpRequest;
import org.springframework.mock.http.server.reactive.test.MockServerHttpRequest;
import org.springframework.mock.web.test.server.MockServerWebExchange;
import org.springframework.web.filter.reactive.ForwardedHeaderFilter;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
@ -92,6 +91,7 @@ public class CorsUtilsTests { @@ -92,6 +91,7 @@ public class CorsUtilsTests {
}
@Test // SPR-16362
@SuppressWarnings("deprecation")
public void isSameOriginWithDifferentSchemes() {
MockServerHttpRequest request = MockServerHttpRequest
.get("http://mydomain1.com")
@ -100,6 +100,7 @@ public class CorsUtilsTests { @@ -100,6 +100,7 @@ public class CorsUtilsTests {
assertFalse(CorsUtils.isSameOrigin(request));
}
@SuppressWarnings("deprecation")
private void testWithXForwardedHeaders(String serverName, int port,
String forwardedProto, String forwardedHost, int forwardedPort, String originHeader) {
@ -123,6 +124,7 @@ public class CorsUtilsTests { @@ -123,6 +124,7 @@ public class CorsUtilsTests {
assertTrue(CorsUtils.isSameOrigin(request));
}
@SuppressWarnings("deprecation")
private void testWithForwardedHeader(String serverName, int port,
String forwardedHeader, String originHeader) {
@ -140,10 +142,11 @@ public class CorsUtilsTests { @@ -140,10 +142,11 @@ public class CorsUtilsTests {
}
// SPR-16668
@SuppressWarnings("deprecation")
private ServerHttpRequest adaptFromForwardedHeaders(MockServerHttpRequest.BaseBuilder<?> builder) {
AtomicReference<ServerHttpRequest> requestRef = new AtomicReference<>();
MockServerWebExchange exchange = MockServerWebExchange.from(builder);
new ForwardedHeaderFilter().filter(exchange, exchange2 -> {
new org.springframework.web.filter.reactive.ForwardedHeaderFilter().filter(exchange, exchange2 -> {
requestRef.set(exchange2.getRequest());
return Mono.empty();
}).block();

1
spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/support/DefaultHandlerExceptionResolverTests.java

@ -133,6 +133,7 @@ public class DefaultHandlerExceptionResolverTests { @@ -133,6 +133,7 @@ public class DefaultHandlerExceptionResolverTests {
}
@Test
@SuppressWarnings("deprecation")
public void handleHttpMessageNotReadable() {
HttpMessageNotReadableException ex = new HttpMessageNotReadableException("foo");
ModelAndView mav = exceptionResolver.resolveException(request, response, null, ex);

Loading…
Cancel
Save