@Test
public void authenticateUserWithUsernameAndPassword() {

  when(userRepository.findByUsernameAndPassword(username, password)).thenReturn(user);
  when(tokenStore.generate(username)).thenReturn(token);
  String token = authenticationService.authenticate(username, password);
  assertThat(token).isEqualTo(this.token);
}