@Test void testTokenForDisabledUser() { UserDetails userDetails = mock(UserDetails.class); doThrow(new DisabledException("User is disabled.")).when(userDetailsChecker).check(userDetails); assertThrows( DisabledException.class, () -> runAsUserTokenFactory.create("test", userDetails, null)); }
public RunAsUserToken create( String key, UserDetails userDetails, Class<? extends Authentication> originalAuthentication) { userDetailsChecker.check(userDetails); return new RunAsUserToken( key, userDetails.getUsername(), userDetails.getPassword(), userDetails.getAuthorities(), originalAuthentication); }
RunAsUserTokenFactory { public RunAsUserToken create( String key, UserDetails userDetails, Class<? extends Authentication> originalAuthentication) { userDetailsChecker.check(userDetails); return new RunAsUserToken( key, userDetails.getUsername(), userDetails.getPassword(), userDetails.getAuthorities(), originalAuthentication); } }
RunAsUserTokenFactory { public RunAsUserToken create( String key, UserDetails userDetails, Class<? extends Authentication> originalAuthentication) { userDetailsChecker.check(userDetails); return new RunAsUserToken( key, userDetails.getUsername(), userDetails.getPassword(), userDetails.getAuthorities(), originalAuthentication); } RunAsUserTokenFactory(UserDetailsChecker userDetailsChecker); }
RunAsUserTokenFactory { public RunAsUserToken create( String key, UserDetails userDetails, Class<? extends Authentication> originalAuthentication) { userDetailsChecker.check(userDetails); return new RunAsUserToken( key, userDetails.getUsername(), userDetails.getPassword(), userDetails.getAuthorities(), originalAuthentication); } RunAsUserTokenFactory(UserDetailsChecker userDetailsChecker); RunAsUserToken create(
      String key, UserDetails userDetails, Class<? extends Authentication> originalAuthentication); }
RunAsUserTokenFactory { public RunAsUserToken create( String key, UserDetails userDetails, Class<? extends Authentication> originalAuthentication) { userDetailsChecker.check(userDetails); return new RunAsUserToken( key, userDetails.getUsername(), userDetails.getPassword(), userDetails.getAuthorities(), originalAuthentication); } RunAsUserTokenFactory(UserDetailsChecker userDetailsChecker); RunAsUserToken create(
      String key, UserDetails userDetails, Class<? extends Authentication> originalAuthentication);  }