@ -32,7 +32,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
@@ -32,7 +32,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod ;
import org.springframework.web.context.support.StaticWebApplicationContext ;
import org.springframework.web.method.HandlerMethod ;
import org.springframework.web.reactive.method.annotation.RequestMappingHandlerMapping ;
import static org.junit.Assert.assertEquals ;
@ -43,6 +42,7 @@ public class RequestMappingHandlerMappingTests {
@@ -43,6 +42,7 @@ public class RequestMappingHandlerMappingTests {
private RequestMappingHandlerMapping mapping ;
@Before
public void setup ( ) {
StaticWebApplicationContext wac = new StaticWebApplicationContext ( ) ;
@ -52,6 +52,7 @@ public class RequestMappingHandlerMappingTests {
@@ -52,6 +52,7 @@ public class RequestMappingHandlerMappingTests {
this . mapping = ( RequestMappingHandlerMapping ) wac . getBean ( "handlerMapping" ) ;
}
@Test
public void path ( ) throws Exception {
ReactiveServerHttpRequest request = new MockServerHttpRequest ( HttpMethod . GET , "boo" ) ;
@ -68,10 +69,6 @@ public class RequestMappingHandlerMappingTests {
@@ -68,10 +69,6 @@ public class RequestMappingHandlerMappingTests {
request = new MockServerHttpRequest ( HttpMethod . GET , "foo" ) ;
handler = ( HandlerMethod ) this . mapping . getHandler ( request ) ;
assertEquals ( TestController . class . getMethod ( "getFoo" ) , handler . getMethod ( ) ) ;
request = new MockServerHttpRequest ( HttpMethod . PUT , "foo" ) ;
handler = ( HandlerMethod ) this . mapping . getHandler ( request ) ;
assertEquals ( TestController . class . getMethod ( "foo" ) , handler . getMethod ( ) ) ;
}
@ -79,11 +76,6 @@ public class RequestMappingHandlerMappingTests {
@@ -79,11 +76,6 @@ public class RequestMappingHandlerMappingTests {
@SuppressWarnings ( "unused" )
private static class TestController {
@RequestMapping ( "foo" )
public String foo ( ) {
return "foo" ;
}
@RequestMapping ( path = "foo" , method = RequestMethod . POST )
public String postFoo ( ) {
return "postFoo" ;
@ -106,7 +98,11 @@ public class RequestMappingHandlerMappingTests {
@@ -106,7 +98,11 @@ public class RequestMappingHandlerMappingTests {
}
private static class MockServerHttpRequest implements ReactiveServerHttpRequest {
/ * *
* TODO : this is more widely needed .
* /
private static class MockServerHttpRequest implements ReactiveServerHttpRequest {
private HttpMethod method ;