Examples of SimpleMethodInvocation


Examples of org.springframework.security.util.SimpleMethodInvocation

        am.vote(joe, mi, createAttributes(new PreInvocationExpressionAttribute("(filterObject == 'joe')", "collcetion", null)));
    }

    @Test(expected=IllegalArgumentException.class)
    public void nullNamedFilterTargetIsRejected() throws Exception {
        MethodInvocation mi = new SimpleMethodInvocation(new TargetImpl(), methodTakingACollection(), new Object[] {null});
        am.vote(joe, mi, createAttributes(new PreInvocationExpressionAttribute("(filterObject == 'joe')", "collection", null)));
    }
View Full Code Here

Examples of org.springframework.security.util.SimpleMethodInvocation

        am.vote(joe, mi, createAttributes(new PreInvocationExpressionAttribute("(filterObject == 'joe')", "collection", null)));
    }

    @Test
    public void ruleDefinedInAClassMethodIsApplied() throws Exception {
        MethodInvocation mi = new SimpleMethodInvocation(new TargetImpl(), methodTakingAString(), "joe");
        assertEquals(AccessDecisionVoter.ACCESS_GRANTED, am.vote(joe, mi,
                createAttributes(new PreInvocationExpressionAttribute(null, null, "T(org.springframework.security.access.expression.method.SecurityRules).isJoe(#argument)"))));
    }
View Full Code Here

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

Examples of org.springframework.security.util.SimpleMethodInvocation

                new AuthenticationCredentialsNotFoundException("test"));
    }

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

Examples of org.springframework.security.util.SimpleMethodInvocation

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

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

Examples of org.springframework.security.util.SimpleMethodInvocation

        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

Examples of org.springframework.security.util.SimpleMethodInvocation

        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

Examples of org.springframework.security.util.SimpleMethodInvocation

    }

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

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

Examples of org.springframework.security.util.SimpleMethodInvocation

        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

Examples of org.springframework.security.util.SimpleMethodInvocation

        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
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.