@Test(expected = IllegalStateException.class) public void testGetUserPrincipalBeforeLogin() { authentication.getUserPrincipal(); }
@Nullable @Override public Principal getUserPrincipal() { if (principal == null) { throw new IllegalStateException("Principal can only be retrieved after successful authentication."); } return principal; }
UserAuthentication implements Authentication, UserConstants { @Nullable @Override public Principal getUserPrincipal() { if (principal == null) { throw new IllegalStateException("Principal can only be retrieved after successful authentication."); } return principal; } }
UserAuthentication implements Authentication, UserConstants { @Nullable @Override public Principal getUserPrincipal() { if (principal == null) { throw new IllegalStateException("Principal can only be retrieved after successful authentication."); } return principal; } UserAuthentication(@NotNull UserConfiguration config, @NotNull Root root, @Nullable String loginId); }
UserAuthentication implements Authentication, UserConstants { @Nullable @Override public Principal getUserPrincipal() { if (principal == null) { throw new IllegalStateException("Principal can only be retrieved after successful authentication."); } return principal; } UserAuthentication(@NotNull UserConfiguration config, @NotNull Root root, @Nullable String loginId); @Override boolean authenticate(@Nullable Credentials credentials); @Nullable @Override String getUserId(); @Nullable @Override Principal getUserPrincipal(); }
UserAuthentication implements Authentication, UserConstants { @Nullable @Override public Principal getUserPrincipal() { if (principal == null) { throw new IllegalStateException("Principal can only be retrieved after successful authentication."); } return principal; } UserAuthentication(@NotNull UserConfiguration config, @NotNull Root root, @Nullable String loginId); @Override boolean authenticate(@Nullable Credentials credentials); @Nullable @Override String getUserId(); @Nullable @Override Principal getUserPrincipal(); static final String PARAM_PASSWORD_EXPIRY_FOR_ADMIN; }