Package org.springframework.security.util

Examples of org.springframework.security.util.SimpleMethodInvocation


                new AuthenticationCredentialsNotFoundException("test"));
    }

    @Test(expected=IllegalArgumentException.class)
    public void testRejectsNulls2() {
        new AuthenticationCredentialsNotFoundEvent(new SimpleMethodInvocation(), null,
                new AuthenticationCredentialsNotFoundException("test"));
    }
View Full Code Here


                new AuthenticationCredentialsNotFoundException("test"));
    }

    @Test(expected=IllegalArgumentException.class)
    public void testRejectsNulls3() {
        new AuthenticationCredentialsNotFoundEvent(new SimpleMethodInvocation(), SecurityConfig.createList("TEST"), null);
    }
View Full Code Here

        new AuthorizationFailureEvent(null, attributes, foo, exception);
    }

    @Test(expected=IllegalArgumentException.class)
    public void rejectsNullAttributesList() {
        new AuthorizationFailureEvent(new SimpleMethodInvocation(), null, foo, exception);
    }
View Full Code Here

        new AuthorizationFailureEvent(new SimpleMethodInvocation(), null, foo, exception);
    }

    @Test(expected=IllegalArgumentException.class)
    public void rejectsNullAuthentication() {
        new AuthorizationFailureEvent(new SimpleMethodInvocation(), attributes, null, exception);
    }
View Full Code Here

        new AuthorizationFailureEvent(new SimpleMethodInvocation(), attributes, null, exception);
    }

    @Test(expected=IllegalArgumentException.class)
    public void rejectsNullException() {
        new AuthorizationFailureEvent(new SimpleMethodInvocation(), attributes, foo, null);
    }
View Full Code Here

    }

    @Test(expected=IllegalArgumentException.class)
    public void testRejectsNulls2() {

        new AuthorizedEvent(new SimpleMethodInvocation(), null, new UsernamePasswordAuthenticationToken("foo", "bar"));
    }
View Full Code Here

        new AuthorizedEvent(new SimpleMethodInvocation(), null, new UsernamePasswordAuthenticationToken("foo", "bar"));
    }

    @Test(expected=IllegalArgumentException.class)
    public void testRejectsNulls3() {
        new AuthorizedEvent(new SimpleMethodInvocation(), SecurityConfig.createList("TEST"), null);
    }
View Full Code Here

        when(delegate.getAttributes(Matchers.<Method>any(), Matchers.any(Class.class))).thenReturn(null);
        sources.add(delegate);
        mds = new DelegatingMethodSecurityMetadataSource(sources);
        assertSame(sources, mds.getMethodSecurityMetadataSources());
        assertTrue(mds.getAllConfigAttributes().isEmpty());
        MethodInvocation mi = new SimpleMethodInvocation(null, String.class.getMethod("toString"));
        assertEquals(Collections.emptyList(), mds.getAttributes(mi));
        // Exercise the cached case
        assertEquals(Collections.emptyList(), mds.getAttributes(mi));
    }
View Full Code Here

        when(delegate.getAttributes(toString, String.class)).thenReturn(attributes);
        sources.add(delegate);
        mds = new DelegatingMethodSecurityMetadataSource(sources);
        assertSame(sources, mds.getMethodSecurityMetadataSources());
        assertTrue(mds.getAllConfigAttributes().isEmpty());
        MethodInvocation mi = new SimpleMethodInvocation("", toString);
        assertSame(attributes, mds.getAttributes(mi));
        // Exercise the cached case
        assertSame(attributes, mds.getAttributes(mi));
        assertTrue(mds.getAttributes(new SimpleMethodInvocation(null, String.class.getMethod("length"))).isEmpty());
    }
View Full Code Here

        List<ConfigAttribute> attr2 = SecurityConfig.createList(new String[] {"GIVE_ME_SWAP2"});
        List<ConfigAttribute> attr3 = SecurityConfig.createList(new String[] {"GIVE_ME_SWAP3"});
        List<ConfigAttribute> attr2and3 = SecurityConfig.createList(new String[] {"GIVE_ME_SWAP2","GIVE_ME_SWAP3"});
        List<ConfigAttribute> attr4 = SecurityConfig.createList(new String[] {"NEVER_CAUSES_SWAP"});

        assertEquals("swap1", manager.decide(null, new SimpleMethodInvocation(), attr1, "content-before-swapping"));

        assertEquals("swap2", manager.decide(null, new SimpleMethodInvocation(), attr2, "content-before-swapping"));

        assertEquals("swap3", manager.decide(null, new SimpleMethodInvocation(), attr3, "content-before-swapping"));

        assertEquals("content-before-swapping",
            manager.decide(null, new SimpleMethodInvocation(), attr4, "content-before-swapping"));

        assertEquals("swap3", manager.decide(null, new SimpleMethodInvocation(), attr2and3, "content-before-swapping"));
    }
View Full Code Here

TOP

Related Classes of org.springframework.security.util.SimpleMethodInvocation

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.