From 23fe1e2934336351615556f243de694e06b5e553 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Thu, 5 Jul 2012 01:20:43 +0200 Subject: [PATCH] Cannot amend properties in RequestMappingHandlerMapping (e.g. useSuffixPatternMatch) using a bean post processor as ApplicationContextAwareProcessor always fires first initialising RequestMappingHandlerMapping Issue: SPR-9371 --- .../web/servlet/handler/HandlerMethodMappingTests.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/org.springframework.web.servlet/src/test/java/org/springframework/web/servlet/handler/HandlerMethodMappingTests.java b/org.springframework.web.servlet/src/test/java/org/springframework/web/servlet/handler/HandlerMethodMappingTests.java index 755eb6a62d..fe2e20abef 100644 --- a/org.springframework.web.servlet/src/test/java/org/springframework/web/servlet/handler/HandlerMethodMappingTests.java +++ b/org.springframework.web.servlet/src/test/java/org/springframework/web/servlet/handler/HandlerMethodMappingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -98,12 +98,14 @@ public class HandlerMethodMappingTests { AbstractHandlerMethodMapping mapping1 = new MyHandlerMethodMapping(); mapping1.setApplicationContext(new StaticApplicationContext(cxt)); + mapping1.afterPropertiesSet(); assertEquals(0, mapping1.getHandlerMethods().size()); AbstractHandlerMethodMapping mapping2 = new MyHandlerMethodMapping(); mapping2.setDetectHandlerMethodsInAncestorContexts(true); mapping2.setApplicationContext(new StaticApplicationContext(cxt)); + mapping2.afterPropertiesSet(); assertEquals(2, mapping2.getHandlerMethods().size()); }