Clean up warnings in the spring-test module

This commit is contained in:
Sam Brannen
2016-03-20 19:37:54 +01:00
parent a5139f3c66
commit 532ed0a4cf
3 changed files with 9 additions and 11 deletions

View File

@@ -131,8 +131,7 @@ public class DelegatingWebConnectionTests {
WebClient webClient = new WebClient();
MockMvc mockMvc = MockMvcBuilders.standaloneSetup(TestController.class).build();
MockMvcWebConnection mockConnection = new MockMvcWebConnection(mockMvc);
mockConnection.setWebClient(webClient);
MockMvcWebConnection mockConnection = new MockMvcWebConnection(mockMvc, webClient);
WebRequestMatcher cdnMatcher = new UrlRegexRequestMatcher(".*?//code.jquery.com/.*");
WebConnection httpConnection = new HttpWebConnection(webClient);

View File

@@ -24,6 +24,7 @@ import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.WebConnection;
import com.gargoylesoftware.htmlunit.WebRequest;
import com.gargoylesoftware.htmlunit.WebResponse;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -57,19 +58,19 @@ import static org.mockito.Mockito.when;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
@WebAppConfiguration
@SuppressWarnings("rawtypes")
public class MockMvcConnectionBuilderSupportTests {
private final WebClient client = mock(WebClient.class);
private MockMvcWebConnectionBuilderSupport builder;
@Autowired
private WebApplicationContext wac;
private WebClient client;
private MockMvcWebConnectionBuilderSupport builder;
@Before
public void setup() {
this.client = mock(WebClient.class);
when(this.client.getWebConnection()).thenReturn(mock(WebConnection.class));
this.builder = new MockMvcWebConnectionBuilderSupport(this.wac) {};
}
@@ -145,7 +146,6 @@ public class MockMvcConnectionBuilderSupportTests {
@Configuration
@EnableWebMvc
@SuppressWarnings("unused")
static class Config {
@RestController