From 8a2a1b7a5b62c45c60d8136fa8142833a5ca0661 Mon Sep 17 00:00:00 2001 From: Rob Winch Date: Fri, 25 Jul 2014 16:27:19 -0500 Subject: [PATCH] SEC-2595: Polish --- config/config.gradle | 1 + .../NamespaceGlobalMethodSecurityTests.groovy | 11 +- samples/aspectj-jc/pom.xml | 133 ++++++++++++++++++ 3 files changed, 141 insertions(+), 4 deletions(-) create mode 100644 samples/aspectj-jc/pom.xml diff --git a/config/config.gradle b/config/config.gradle index 497333c508..e8ecb0f285 100644 --- a/config/config.gradle +++ b/config/config.gradle @@ -28,6 +28,7 @@ dependencies { testCompile project(':spring-security-cas'), project(':spring-security-core').sourceSets.test.output, + project(':spring-security-aspects'), 'javax.annotation:jsr250-api:1.0', "org.springframework.ldap:spring-ldap-core:$springLdapVersion", "org.springframework:spring-expression:$springVersion", diff --git a/config/src/test/groovy/org/springframework/security/config/annotation/method/configuration/NamespaceGlobalMethodSecurityTests.groovy b/config/src/test/groovy/org/springframework/security/config/annotation/method/configuration/NamespaceGlobalMethodSecurityTests.groovy index 534ad6075e..e289ab5819 100644 --- a/config/src/test/groovy/org/springframework/security/config/annotation/method/configuration/NamespaceGlobalMethodSecurityTests.groovy +++ b/config/src/test/groovy/org/springframework/security/config/annotation/method/configuration/NamespaceGlobalMethodSecurityTests.groovy @@ -15,11 +15,14 @@ */ package org.springframework.security.config.annotation.method.configuration +import org.springframework.security.access.intercept.aspectj.AspectJMethodSecurityInterceptor + import static org.fest.assertions.Assertions.assertThat import static org.junit.Assert.fail import java.lang.reflect.Method +import org.springframework.security.access.intercept.aspectj.aspect.AnnotationSecurityAspect import org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator import org.springframework.beans.factory.BeanCreationException import org.springframework.context.ConfigurableApplicationContext @@ -188,8 +191,8 @@ public class NamespaceGlobalMethodSecurityTests extends BaseSpringSpec { when: context = new AnnotationConfigApplicationContext(AspectJModeConfig) then: - AnnotationAwareAspectJAutoProxyCreator autoProxyCreator = context.getBean(AnnotationAwareAspectJAutoProxyCreator) - autoProxyCreator.proxyTargetClass == true + context.getBean(AnnotationSecurityAspect) + context.getBean(AspectJMethodSecurityInterceptor) } @Configuration @@ -201,8 +204,8 @@ public class NamespaceGlobalMethodSecurityTests extends BaseSpringSpec { when: context = new AnnotationConfigApplicationContext(BaseMethodConfig,AspectJModeExtendsGMSCConfig) then: - AnnotationAwareAspectJAutoProxyCreator autoProxyCreator = context.getBean(AnnotationAwareAspectJAutoProxyCreator) - autoProxyCreator.proxyTargetClass == false + context.getBean(AnnotationSecurityAspect) + context.getBean(AspectJMethodSecurityInterceptor) } @Configuration diff --git a/samples/aspectj-jc/pom.xml b/samples/aspectj-jc/pom.xml new file mode 100644 index 0000000000..ac9430d1d0 --- /dev/null +++ b/samples/aspectj-jc/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + org.springframework.security + spring-security-samples-aspectj-jc + 4.0.0.CI-SNAPSHOT + spring-security-samples-aspectj-jc + spring-security-samples-aspectj-jc + http://spring.io/spring-security + + spring.io + http://spring.io/ + + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + + rwinch + Rob Winch + rwinch@gopivotal.com + + + + scm:git:git://github.com/spring-projects/spring-security + scm:git:git://github.com/spring-projects/spring-security + https://github.com/spring-projects/spring-security + + + + + maven-compiler-plugin + + 1.7 + 1.7 + + + + + + + spring-snasphot + https://repo.spring.io/snapshot + + + + + org.springframework.security + spring-security-config + 4.0.0.CI-SNAPSHOT + compile + + + org.springframework.security + spring-security-core + 4.0.0.CI-SNAPSHOT + compile + + + org.springframework + spring-core + 4.1.0.BUILD-SNAPSHOT + compile + + + commons-logging + commons-logging + + + + + commons-logging + commons-logging + 1.1.1 + compile + true + + + org.aspectj + aspectjrt + 1.6.10 + compile + true + + + org.springframework.security + spring-security-aspects + 4.0.0.CI-SNAPSHOT + runtime + + + ch.qos.logback + logback-classic + 0.9.29 + test + + + junit + junit + 4.11 + test + + + org.easytesting + fest-assert + 1.4 + test + + + org.mockito + mockito-core + 1.9.5 + test + + + org.slf4j + jcl-over-slf4j + 1.7.5 + test + + + org.springframework + spring-test + 4.1.0.BUILD-SNAPSHOT + test + + +