@@ -66,14 +66,33 @@ public void setUp() {
6666 }
6767
6868 @ Test
69- public void noAnnotation () throws Exception {
69+ public void noAnnotationWithoutOrigin () throws Exception {
7070 this .handlerMapping .registerHandler (new MethodLevelController ());
7171 MockHttpServletRequest request = new MockHttpServletRequest ("GET" , "/no" );
7272 HandlerExecutionChain chain = this .handlerMapping .getHandler (request );
7373 CorsConfiguration config = getCorsConfiguration (chain , false );
7474 assertNull (config );
7575 }
7676
77+ @ Test // SPR-12931
78+ public void noAnnotationWithOrigin () throws Exception {
79+ this .handlerMapping .registerHandler (new MethodLevelController ());
80+ this .request .setRequestURI ("/no" );
81+ HandlerExecutionChain chain = this .handlerMapping .getHandler (request );
82+ CorsConfiguration config = getCorsConfiguration (chain , false );
83+ assertNull (config );
84+ }
85+
86+ @ Test // SPR-12931
87+ public void noAnnotationPostWithOrigin () throws Exception {
88+ this .handlerMapping .registerHandler (new MethodLevelController ());
89+ this .request .setMethod ("POST" );
90+ this .request .setRequestURI ("/no" );
91+ HandlerExecutionChain chain = this .handlerMapping .getHandler (request );
92+ CorsConfiguration config = getCorsConfiguration (chain , false );
93+ assertNull (config );
94+ }
95+
7796 @ Test
7897 public void defaultAnnotation () throws Exception {
7998 this .handlerMapping .registerHandler (new MethodLevelController ());
@@ -203,6 +222,10 @@ private static class MethodLevelController {
203222 public void noAnnotation () {
204223 }
205224
225+ @ RequestMapping (value = "/no" , method = RequestMethod .POST )
226+ public void noAnnotationPost () {
227+ }
228+
206229 @ CrossOrigin
207230 @ RequestMapping (value = "/default" , method = RequestMethod .GET )
208231 public void defaultAnnotation () {
0 commit comments