@Test public void testGetUserExists() { UserInfo user = defaultAuthentication.getUserExists(ADMIN_EXAMPLE_COM); UserInfo expected = UserInfo.from(UserInfo.Username.valueOf(WASABI_ADMIN)) .withEmail(ADMIN_EXAMPLE_COM) .withLastName("Admin") .withUserId(WASABI_ADMIN) .withFirstName("Wasabi").build(); assertEquals(user, expected); }
@Override public UserInfo getUserExists(final String userEmail) { LOGGER.debug("Authentication token received as: {}", userEmail); if (!isBlank(userEmail)) { return userDirectory.lookupUserByEmail(userEmail); } else { throw new AuthenticationException("user does not exists in system"); } }
DefaultAuthentication implements Authentication { @Override public UserInfo getUserExists(final String userEmail) { LOGGER.debug("Authentication token received as: {}", userEmail); if (!isBlank(userEmail)) { return userDirectory.lookupUserByEmail(userEmail); } else { throw new AuthenticationException("user does not exists in system"); } } }
DefaultAuthentication implements Authentication { @Override public UserInfo getUserExists(final String userEmail) { LOGGER.debug("Authentication token received as: {}", userEmail); if (!isBlank(userEmail)) { return userDirectory.lookupUserByEmail(userEmail); } else { throw new AuthenticationException("user does not exists in system"); } } @Inject  DefaultAuthentication(final UserDirectory userDirectory); }
DefaultAuthentication implements Authentication { @Override public UserInfo getUserExists(final String userEmail) { LOGGER.debug("Authentication token received as: {}", userEmail); if (!isBlank(userEmail)) { return userDirectory.lookupUserByEmail(userEmail); } else { throw new AuthenticationException("user does not exists in system"); } } @Inject  DefaultAuthentication(final UserDirectory userDirectory); @Override LoginToken logIn(final String authHeader); @Override LoginToken verifyToken(final String tokenHeader); @Override boolean logOut(final String tokenHeader); @Override UserInfo getUserExists(final String userEmail); }
DefaultAuthentication implements Authentication { @Override public UserInfo getUserExists(final String userEmail) { LOGGER.debug("Authentication token received as: {}", userEmail); if (!isBlank(userEmail)) { return userDirectory.lookupUserByEmail(userEmail); } else { throw new AuthenticationException("user does not exists in system"); } } @Inject  DefaultAuthentication(final UserDirectory userDirectory); @Override LoginToken logIn(final String authHeader); @Override LoginToken verifyToken(final String tokenHeader); @Override boolean logOut(final String tokenHeader); @Override UserInfo getUserExists(final String userEmail); static final String BASIC; static final String EMPTY; }