提交 4b682275 编写于 作者: S Sam Brannen

Clean up warnings in spring-test

上级 5b901852
...@@ -85,11 +85,13 @@ public class MockMvcWebConnectionTests { ...@@ -85,11 +85,13 @@ public class MockMvcWebConnectionTests {
} }
@Test(expected = IllegalArgumentException.class) @Test(expected = IllegalArgumentException.class)
@SuppressWarnings("resource")
public void contextPathDoesNotStartWithSlash() throws IOException { public void contextPathDoesNotStartWithSlash() throws IOException {
new MockMvcWebConnection(this.mockMvc, "context"); new MockMvcWebConnection(this.mockMvc, "context");
} }
@Test(expected = IllegalArgumentException.class) @Test(expected = IllegalArgumentException.class)
@SuppressWarnings("resource")
public void contextPathEndsWithSlash() throws IOException { public void contextPathEndsWithSlash() throws IOException {
new MockMvcWebConnection(this.mockMvc, "/context/"); new MockMvcWebConnection(this.mockMvc, "/context/");
} }
......
...@@ -101,7 +101,6 @@ public class AsyncControllerJavaConfigTests { ...@@ -101,7 +101,6 @@ public class AsyncControllerJavaConfigTests {
@Configuration @Configuration
@EnableWebMvc @EnableWebMvc
@SuppressWarnings("unused")
static class WebConfig extends WebMvcConfigurerAdapter { static class WebConfig extends WebMvcConfigurerAdapter {
@Override @Override
...@@ -122,7 +121,6 @@ public class AsyncControllerJavaConfigTests { ...@@ -122,7 +121,6 @@ public class AsyncControllerJavaConfigTests {
} }
@RestController @RestController
@SuppressWarnings("unused")
static class AsyncController { static class AsyncController {
@RequestMapping(path = "/callable") @RequestMapping(path = "/callable")
......
...@@ -143,7 +143,6 @@ public class JavaConfigTests { ...@@ -143,7 +143,6 @@ public class JavaConfigTests {
@Configuration @Configuration
@EnableWebMvc @EnableWebMvc
@SuppressWarnings("unused")
static class WebConfig extends WebMvcConfigurerAdapter { static class WebConfig extends WebMvcConfigurerAdapter {
@Autowired @Autowired
......
...@@ -28,7 +28,6 @@ import org.junit.Test; ...@@ -28,7 +28,6 @@ import org.junit.Test;
import org.springframework.http.converter.json.SpringHandlerInstantiator; import org.springframework.http.converter.json.SpringHandlerInstantiator;
import org.springframework.mock.web.test.MockHttpServletRequest; import org.springframework.mock.web.test.MockHttpServletRequest;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.context.WebApplicationContext; import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils; import org.springframework.web.context.support.WebApplicationContextUtils;
...@@ -138,7 +137,6 @@ public class StandaloneMockMvcBuilderTests { ...@@ -138,7 +137,6 @@ public class StandaloneMockMvcBuilderTests {
@Controller @Controller
@SuppressWarnings("unused")
private static class PlaceholderController { private static class PlaceholderController {
@RequestMapping(value = "${sys.login.ajax}") @RequestMapping(value = "${sys.login.ajax}")
...@@ -162,7 +160,6 @@ public class StandaloneMockMvcBuilderTests { ...@@ -162,7 +160,6 @@ public class StandaloneMockMvcBuilderTests {
} }
@Controller @Controller
@SuppressWarnings("unused")
private static class PersonController { private static class PersonController {
@RequestMapping(value="/persons") @RequestMapping(value="/persons")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册