Clean up warnings in spring-test

This commit is contained in:
Sam Brannen 2017-04-11 17:53:44 +02:00
parent 987421c880
commit 95e78b16f7
3 changed files with 3 additions and 10 deletions

View File

@ -29,7 +29,6 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.StringTokenizer;
import java.util.regex.Pattern;
import javax.servlet.ServletContext;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
@ -70,9 +69,6 @@ import org.springframework.web.util.UriComponentsBuilder;
*/
final class HtmlUnitRequestBuilder implements RequestBuilder, Mergeable {
private static final Pattern LOCALE_PATTERN = Pattern.compile("^\\s*(\\w{2})(?:-(\\w{2}))?(?:;q=(\\d+\\.\\d+))?$");
private final Map<String, MockHttpSession> sessions;
private final WebClient webClient;

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2017 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.
@ -19,8 +19,6 @@ package org.springframework.mock.web;
import java.io.IOException;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletResponse;

View File

@ -35,7 +35,6 @@ import org.springframework.util.concurrent.ListenableFuture;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.client.AsyncRestTemplate;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
@ -44,7 +43,6 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
import static org.junit.Assert.assertEquals;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
/**
* Tests that use a {@link RestTemplate} configured with a
* {@link MockMvcClientHttpRequestFactory} that is in turn configured with a
@ -79,7 +77,8 @@ public class MockMvcClientHttpRequestFactoryTests {
@Test
@SuppressWarnings("deprecation")
public void testAsyncTemplate() throws Exception {
AsyncRestTemplate template = new AsyncRestTemplate(new MockMvcClientHttpRequestFactory(this.mockMvc));
org.springframework.web.client.AsyncRestTemplate template = new org.springframework.web.client.AsyncRestTemplate(
new MockMvcClientHttpRequestFactory(this.mockMvc));
ListenableFuture<ResponseEntity<String>> entity = template.getForEntity("/foo", String.class);
assertEquals("bar", entity.get().getBody());
}