@Test public void testSupports() { final JaasAuthenticationProvider provider = context.mock(JaasAuthenticationProvider.class); final UserDetailsService uds = context.mock(UserDetailsService.class); final Sequence executeSequence = context.sequence("executeSequence"); context.checking(new Expectations() { { oneOf(provider).supports(null); will(returnValue(true)); inSequence(executeSequence); oneOf(provider).supports(null); will(returnValue(false)); inSequence(executeSequence); } }); JaasAuthenticationProviderWrapper sut = new JaasAuthenticationProviderWrapper(provider, uds); assertTrue(sut.supports(null)); assertFalse(sut.supports(null)); context.assertIsSatisfied(); }
@SuppressWarnings("unchecked") public boolean supports(final Class authentication) { return authProvider.supports(authentication); }
JaasAuthenticationProviderWrapper implements
        AuthenticationProvider { @SuppressWarnings("unchecked") public boolean supports(final Class authentication) { return authProvider.supports(authentication); } }
JaasAuthenticationProviderWrapper implements
        AuthenticationProvider { @SuppressWarnings("unchecked") public boolean supports(final Class authentication) { return authProvider.supports(authentication); } JaasAuthenticationProviderWrapper(final JaasAuthenticationProvider inAuthProvider,
            final UserDetailsService inUserDetailsService); }
JaasAuthenticationProviderWrapper implements
        AuthenticationProvider { @SuppressWarnings("unchecked") public boolean supports(final Class authentication) { return authProvider.supports(authentication); } JaasAuthenticationProviderWrapper(final JaasAuthenticationProvider inAuthProvider,
            final UserDetailsService inUserDetailsService); Authentication authenticate(final Authentication authentication); @SuppressWarnings("unchecked") boolean supports(final Class authentication); }
JaasAuthenticationProviderWrapper implements
        AuthenticationProvider { @SuppressWarnings("unchecked") public boolean supports(final Class authentication) { return authProvider.supports(authentication); } JaasAuthenticationProviderWrapper(final JaasAuthenticationProvider inAuthProvider,
            final UserDetailsService inUserDetailsService); Authentication authenticate(final Authentication authentication); @SuppressWarnings("unchecked") boolean supports(final Class authentication);  }