Skip to content

Commit 23fe1e2

Browse files
committed
Cannot amend properties in RequestMappingHandlerMapping (e.g. useSuffixPatternMatch) using a bean post processor as ApplicationContextAwareProcessor always fires first initialising RequestMappingHandlerMapping
Issue: SPR-9371
1 parent 1f64b14 commit 23fe1e2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

org.springframework.web.servlet/src/test/java/org/springframework/web/servlet/handler/HandlerMethodMappingTests.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2011 the original author or authors.
2+
* Copyright 2002-2012 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -98,12 +98,14 @@ public void testDetectHandlerMethodsInAncestorContexts() {
9898

9999
AbstractHandlerMethodMapping<String> mapping1 = new MyHandlerMethodMapping();
100100
mapping1.setApplicationContext(new StaticApplicationContext(cxt));
101+
mapping1.afterPropertiesSet();
101102

102103
assertEquals(0, mapping1.getHandlerMethods().size());
103104

104105
AbstractHandlerMethodMapping<String> mapping2 = new MyHandlerMethodMapping();
105106
mapping2.setDetectHandlerMethodsInAncestorContexts(true);
106107
mapping2.setApplicationContext(new StaticApplicationContext(cxt));
108+
mapping2.afterPropertiesSet();
107109

108110
assertEquals(2, mapping2.getHandlerMethods().size());
109111
}

0 commit comments

Comments
 (0)