SEC-1438: Removed JoinPoint support from AbstractMethodSecurityMetadataSource
This commit is contained in:
@@ -24,7 +24,6 @@ import junit.framework.TestCase;
|
||||
|
||||
import org.aopalliance.intercept.MethodInvocation;
|
||||
import org.springframework.security.ITargetObject;
|
||||
import org.springframework.security.MockJoinPoint;
|
||||
import org.springframework.security.OtherTargetObject;
|
||||
import org.springframework.security.TargetObject;
|
||||
import org.springframework.security.access.ConfigAttribute;
|
||||
@@ -46,22 +45,6 @@ public class MethodSecurityMetadataSourceEditorTests extends TestCase {
|
||||
super.setUp();
|
||||
}
|
||||
|
||||
public void testAspectJJointPointLookup() throws Exception {
|
||||
MethodSecurityMetadataSourceEditor editor = new MethodSecurityMetadataSourceEditor();
|
||||
editor.setAsText("org.springframework.security.TargetObject.countLength=ROLE_ONE,ROLE_TWO,RUN_AS_ENTRY");
|
||||
|
||||
MapBasedMethodSecurityMetadataSource map = (MapBasedMethodSecurityMetadataSource) editor.getValue();
|
||||
|
||||
Class<TargetObject> clazz = TargetObject.class;
|
||||
Method method = clazz.getMethod("countLength", new Class[] {String.class});
|
||||
MockJoinPoint joinPoint = new MockJoinPoint(new TargetObject(), method);
|
||||
|
||||
Collection<ConfigAttribute> returnedCountLength = map.getAttributes(joinPoint);
|
||||
|
||||
List<ConfigAttribute> expectedCountLength = SecurityConfig.createList("ROLE_ONE", "ROLE_TWO", "RUN_AS_ENTRY");
|
||||
assertEquals(expectedCountLength, returnedCountLength);
|
||||
}
|
||||
|
||||
public void testClassNameNotFoundResultsInException() {
|
||||
MethodSecurityMetadataSourceEditor editor = new MethodSecurityMetadataSourceEditor();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user