Package org.springframework.security.access.intercept.method

Examples of org.springframework.security.access.intercept.method.MockMethodInvocation


        assertEquals(SecurityEnum.ADMIN, attrs.toArray()[0]);
    }

    @Test
    public void annotatedAnnotationAtClassLevelIsDetected() throws Exception {
        MockMethodInvocation annotatedAtClassLevel = new MockMethodInvocation(new AnnotatedAnnotationAtClassLevel(), ReturnVoid.class, "doSomething", List.class);

        ConfigAttribute[] attrs = mds.getAttributes(annotatedAtClassLevel).toArray(new ConfigAttribute[0]);

        assertEquals(1, attrs.length);
        assertEquals("CUSTOM", attrs[0].getAttribute());
View Full Code Here


        assertEquals("CUSTOM", attrs[0].getAttribute());
    }

    @Test
    public void annotatedAnnotationAtInterfaceLevelIsDetected() throws Exception {
        MockMethodInvocation annotatedAtInterfaceLevel = new MockMethodInvocation(new AnnotatedAnnotationAtInterfaceLevel(), ReturnVoid2.class, "doSomething", List.class);

        ConfigAttribute[] attrs = mds.getAttributes(annotatedAtInterfaceLevel).toArray(new ConfigAttribute[0]);

        assertEquals(1, attrs.length);
        assertEquals("CUSTOM", attrs[0].getAttribute());
View Full Code Here

        assertEquals("CUSTOM", attrs[0].getAttribute());
    }

    @Test
    public void annotatedAnnotationAtMethodLevelIsDetected() throws Exception {
        MockMethodInvocation annotatedAtMethodLevel = new MockMethodInvocation(new AnnotatedAnnotationAtMethodLevel(), ReturnVoid.class, "doSomething", List.class);
        ConfigAttribute[] attrs = mds.getAttributes(annotatedAtMethodLevel).toArray(new ConfigAttribute[0]);

        assertEquals(1, attrs.length);
        assertEquals("CUSTOM", attrs[0].getAttribute());
    }
View Full Code Here

        assertEquals("CUSTOM", attrs[0].getAttribute());
    }

    @Test
    public void proxyFactoryInterfaceAttributesFound() throws Exception {
        MockMethodInvocation mi = MethodInvocationFactory.createSec2150MethodInvocation();
        Collection<ConfigAttribute> attributes = mds.getAttributes(mi);
        assertThat(attributes.size()).isEqualTo(1);
        assertThat(attributes).onProperty("attribute").containsOnly("ROLE_PERSON");
    }
View Full Code Here

TOP

Related Classes of org.springframework.security.access.intercept.method.MockMethodInvocation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.