Examples of MockMethodInvocation


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

     */
    public static MockMethodInvocation createSec2150MethodInvocation() throws NoSuchMethodException {
        ProxyFactory factory = new ProxyFactory(new Class[] {PersonRepository.class});
        factory.setTargetClass(CrudRepository.class);
        PersonRepository repository = (PersonRepository) factory.getProxy();
        return new MockMethodInvocation(repository, PersonRepository.class , "findAll");
    }
View Full Code Here

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

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

        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

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

        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

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

        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
Copyright © 2018 www.massapi.com. 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.