@Test
public void bcryptAuthenticatorFailsForBadUser() throws Exception {

  when(userDAO.getHashedPassword("invaliduser"))
      .thenReturn(Optional.empty());
  Optional<User> missingUser =
      bcryptAuthenticator.authenticate(new BasicCredentials("invaliduser", "validpass"));
  assertThat(missingUser).isEmpty();
}