Browse Source

Clean up warnings in spring-test

pull/1362/merge
Sam Brannen 8 years ago
parent
commit
95e78b16f7
  1. 4
      spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/HtmlUnitRequestBuilder.java
  2. 4
      spring-test/src/test/java/org/springframework/mock/web/MockHttpServletResponseTests.java
  3. 5
      spring-test/src/test/java/org/springframework/test/web/client/samples/MockMvcClientHttpRequestFactoryTests.java

4
spring-test/src/main/java/org/springframework/test/web/servlet/htmlunit/HtmlUnitRequestBuilder.java

@ -29,7 +29,6 @@ import java.util.Map; @@ -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; @@ -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;

4
spring-test/src/test/java/org/springframework/mock/web/MockHttpServletResponseTests.java

@ -1,5 +1,5 @@ @@ -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; @@ -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;

5
spring-test/src/test/java/org/springframework/test/web/client/samples/MockMvcClientHttpRequestFactoryTests.java

@ -35,7 +35,6 @@ import org.springframework.util.concurrent.ListenableFuture; @@ -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 @@ -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 { @@ -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());
}

Loading…
Cancel
Save