From bf2d2d459798dcdd509c91ed62a9021f333587d1 Mon Sep 17 00:00:00 2001 From: Rob Winch Date: Mon, 1 Dec 2014 12:06:09 -0600 Subject: [PATCH] SEC-2773: Add Test for static delegatingApplicationListener --- .../configuration/WebSecurityConfigurationTests.groovy | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/config/src/test/groovy/org/springframework/security/config/annotation/web/configuration/WebSecurityConfigurationTests.groovy b/config/src/test/groovy/org/springframework/security/config/annotation/web/configuration/WebSecurityConfigurationTests.groovy index e6a4aba443..cb38183da9 100644 --- a/config/src/test/groovy/org/springframework/security/config/annotation/web/configuration/WebSecurityConfigurationTests.groovy +++ b/config/src/test/groovy/org/springframework/security/config/annotation/web/configuration/WebSecurityConfigurationTests.groovy @@ -13,7 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.security.config.annotation.web.configuration; +package org.springframework.security.config.annotation.web.configuration + +import java.lang.reflect.Modifier import static org.junit.Assert.* @@ -342,4 +344,9 @@ class WebSecurityConfigurationTests extends BaseSpringSpec { @EnableWebSecurity @Configuration static class ChildConfig extends WebSecurityConfigurerAdapter { } + + def "SEC-2773: delegatingApplicationListener is static method"() { + expect: 'delegatingApplicationListener to prevent premature instantiation of WebSecurityConfiguration' + Modifier.isStatic(WebSecurityConfiguration.metaClass.methods.find { it.name == 'delegatingApplicationListener'}.modifiers) + } }