Buggy code:
public class UriTemplateServletAnnotationControllerTests { private DispatcherServlet servlet ; @ Test public void simple ( ) throws Exception { } @ Test public void multiple ( ) throws Exception { } @ Test public void binding ( ) throws Exception { } @ Test public void ambiguous ( ) throws Exception { } @ Test public void relative ( ) throws Exception { } @ Test public void extension ( ) throws Exception { } @ Test public void typeConversionError ( ) throws Exception { } @ Test public void explicitSubPath ( ) throws Exception { } @ Test public void implicitSubPath ( ) throws Exception { } @ Test public void crud ( ) throws Exception { } @ Test public void methodNotSupported ( ) throws Exception { } private void initServlet ( final Class < ? > controllerclass ) throws ServletException { } @ Test public void noDefaultSuffixPattern ( ) throws Exception { servlet = new DispatcherServlet ( ) { @ Override protected WebApplicationContext createWebApplicationContext ( WebApplicationContext parent ) throws BeansException { GenericWebApplicationContext wac = new GenericWebApplicationContext ( ) ; wac . registerBeanDefinition ( "controller" , new RootBeanDefinition ( UriTemplateServletAnnotationControllerTests . ImplicitSubPathController . class ) ) ; RootBeanDefinition mappingDef = new RootBeanDefinition ( DefaultAnnotationHandlerMapping . class ) ; <START_BUG> mappingDef . getPropertyValues ( ) . addPropertyValue ( "useDefaultSuffixPattern" , false ) ; <END_BUG> wac . registerBeanDefinition ( "handlerMapping" , mappingDef ) ; wac . refresh ( ) ; return wac ; } } ; servlet . init ( new MockServletConfig ( ) ) ; MockHttpServletRequest request = new MockHttpServletRequest ( "GET" , "//hotels//hotel.with.dot" ) ; MockHttpServletResponse response = new MockHttpServletResponse ( ) ; servlet . service ( request , response ) ; assertEquals ( "test-hotel.with.dot" , response . getContentAsString ( ) ) ; } @ Controller public static class SimpleUriTemplateController { @ RequestMapping ( "//{root}" ) public void handle ( @ PathVariable ( "root" ) int root , Writer writer ) throws IOException { } } @ Controller public static class MultipleUriTemplateController { @ RequestMapping ( "//hotels//{hotel}//bookings//{booking}-{other}" ) public void handle ( @ PathVariable ( "hotel" ) String hotel , @ PathVariable int booking , @ PathVariable String other , Writer writer ) throws IOException { } } @ Controller public static class BindingUriTemplateController { @ InitBinder public void initBinder ( WebDataBinder binder , @ PathVariable ( "hotel" ) String hotel ) { } @ RequestMapping ( "//hotels//{hotel}//dates//{date}" ) public void handle ( @ PathVariable ( "hotel" ) String hotel , @ PathVariable Date date , Writer writer ) throws IOException { } } @ Controller public static class NonBindingUriTemplateController { @ RequestMapping ( "//hotels//{hotel}//dates//{date}" ) public void handle ( @ PathVariable ( "hotel" ) String hotel , @ PathVariable Date date , Writer writer ) throws IOException { } } @ Controller @ RequestMapping ( "//hotels//{hotel}" ) public static class RelativePathUriTemplateController { @ RequestMapping ( "bookings//{booking}" ) public void handle ( @ PathVariable ( "hotel" ) String hotel , @ PathVariable int booking , Writer writer ) throws IOException { } } @ Controller @ RequestMapping ( "//hotels" ) public static class AmbiguousUriTemplateController { @ RequestMapping ( "//{hotel}" ) public void handleVars ( @ PathVariable ( "hotel" ) String hotel , Writer writer ) throws IOException { } @ RequestMapping ( "//new" ) public void handleSpecific ( Writer writer ) throws IOException { } @ RequestMapping ( "//*" ) public void handleWildCard ( Writer writer ) throws IOException { } } @ Controller @ RequestMapping ( "//hotels//*" ) public static class ExplicitSubPathController { @ RequestMapping ( "{hotel}" ) public void handleHotel ( @ PathVariable String hotel , Writer writer ) throws IOException { } } @ Controller @ RequestMapping ( "hotels" ) public static class ImplicitSubPathController { @ RequestMapping ( "{hotel}" ) public void handleHotel ( @ PathVariable String hotel , Writer writer ) throws IOException { } } @ Controller @ RequestMapping ( "hotels" ) public static class CrudController { @ RequestMapping ( method = RequestMethod . GET ) public void list ( Writer writer ) throws IOException { } @ RequestMapping ( method = RequestMethod . POST ) public void create ( Writer writer ) throws IOException { } @ RequestMapping ( value = "//{hotel}" , method = RequestMethod . GET ) public void show ( @ PathVariable String hotel , Writer writer ) throws IOException { } @ RequestMapping ( value = "{hotel}" , method = RequestMethod . PUT ) public void createOrUpdate ( @ PathVariable String hotel , Writer writer ) throws IOException { } @ RequestMapping ( value = "{hotel}" , method = RequestMethod . DELETE ) public void remove ( @ PathVariable String hotel , Writer writer ) throws IOException { } } @ Controller @ RequestMapping ( "//hotels" ) public static class MethodNotAllowedController { @ RequestMapping ( method = RequestMethod . GET ) public void list ( Writer writer ) { } @ RequestMapping ( method = RequestMethod . GET , value = "{hotelId}" ) public void show ( @ PathVariable long hotelId , Writer writer ) { } @ RequestMapping ( method = RequestMethod . PUT , value = "{hotelId}" ) public void createOrUpdate ( @ PathVariable long hotelId , Writer writer ) { } @ RequestMapping ( method = RequestMethod . DELETE , value = "//{hotelId}" ) public void remove ( @ PathVariable long hotelId , Writer writer ) { } } }

Fix:
mappingDef . getPropertyValues ( ) . add ( "useDefaultSuffixPattern" , false ) ;