diff --git a/spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/HtmlUnitRequestBuilder.java b/spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/HtmlUnitRequestBuilder.java index cc19e360a2..ba9d6764a4 100644 --- a/spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/HtmlUnitRequestBuilder.java +++ b/spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/HtmlUnitRequestBuilder.java @@ -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 sessions; private final WebClient webClient; diff --git a/spring-test/src/test/java/org/springframework/mock/web/MockHttpServletResponseTests.java b/spring-test/src/test/java/org/springframework/mock/web/MockHttpServletResponseTests.java index 5d4b5d2a76..07e41989ef 100644 --- a/spring-test/src/test/java/org/springframework/mock/web/MockHttpServletResponseTests.java +++ b/spring-test/src/test/java/org/springframework/mock/web/MockHttpServletResponseTests.java @@ -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; diff --git a/spring-test/src/test/java/org/springframework/test/web/client/samples/MockMvcClientHttpRequestFactoryTests.java b/spring-test/src/test/java/org/springframework/test/web/client/samples/MockMvcClientHttpRequestFactoryTests.java index 0b72717cc4..2d49a4904c 100644 --- a/spring-test/src/test/java/org/springframework/test/web/client/samples/MockMvcClientHttpRequestFactoryTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/client/samples/MockMvcClientHttpRequestFactoryTests.java @@ -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> entity = template.getForEntity("/foo", String.class); assertEquals("bar", entity.get().getBody()); }