Examples of AfterInvocationManager


Examples of org.springframework.security.access.intercept.AfterInvocationManager

        FilterChain chain = fi.getChain();

        doThrow(new RuntimeException()).when(chain).doFilter(any(HttpServletRequest.class), any(HttpServletResponse.class));
        when(ods.getAttributes(fi)).thenReturn(SecurityConfig.createList("MOCK_OK"));

        AfterInvocationManager aim = mock(AfterInvocationManager.class);
        interceptor.setAfterInvocationManager(aim);

        try {
            interceptor.invoke(fi);
            fail("Expected exception");
View Full Code Here

Examples of org.springframework.security.access.intercept.AfterInvocationManager

        FilterChain chain = fi.getChain();

        doThrow(new RuntimeException()).when(chain).doFilter(any(HttpServletRequest.class), any(HttpServletResponse.class));
        when(ods.getAttributes(fi)).thenReturn(SecurityConfig.createList("MOCK_OK"));

        AfterInvocationManager aim = mock(AfterInvocationManager.class);
        interceptor.setAfterInvocationManager(aim);

        try {
            interceptor.invoke(fi);
            fail("Expected exception");
View Full Code Here

Examples of org.springframework.security.access.intercept.AfterInvocationManager

    @Test
    public void afterInvocationManagerIsNotInvokedIfExceptionIsRaised() throws Throwable {
        token.setAuthenticated(true);
        SecurityContextHolder.getContext().setAuthentication(token);

        AfterInvocationManager aim = mock(AfterInvocationManager.class);
        interceptor.setAfterInvocationManager(aim);

        when(aspectJCallback.proceedWithObject()).thenThrow(new RuntimeException());

        try {
View Full Code Here

Examples of org.springframework.security.access.intercept.AfterInvocationManager

    }

    @Test
    public void gettersReturnExpectedData() {
        RunAsManager runAs = mock(RunAsManager.class);
        AfterInvocationManager aim = mock(AfterInvocationManager.class);
        interceptor.setRunAsManager(runAs);
        interceptor.setAfterInvocationManager(aim);
        assertEquals(adm, interceptor.getAccessDecisionManager());
        assertEquals(runAs, interceptor.getRunAsManager());
        assertEquals(authman, interceptor.getAuthenticationManager());
View Full Code Here

Examples of org.springframework.security.access.intercept.AfterInvocationManager

        interceptor.afterPropertiesSet();
    }

    @Test(expected=IllegalArgumentException.class)
    public void intitalizationRejectsAfterInvocationManagerThatDoesNotSupportMethodInvocation() throws Exception {
        final AfterInvocationManager aim = mock(AfterInvocationManager.class);
        when(aim.supports(MethodInvocation.class)).thenReturn(false);
        interceptor.setAfterInvocationManager(aim);
        interceptor.afterPropertiesSet();
    }
View Full Code Here

Examples of org.springframework.security.access.intercept.AfterInvocationManager

        MethodInvocation mi = mock(MethodInvocation.class);
        token.setAuthenticated(true);
        SecurityContextHolder.getContext().setAuthentication(token);
        mdsReturnsUserRole();

        AfterInvocationManager aim = mock(AfterInvocationManager.class);
        interceptor.setAfterInvocationManager(aim);

        when(mi.proceed()).thenThrow(new Throwable());

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