@Test
public void smokeTest_loadValidUser_sameCase() {

    // Setup user.
    final String userEmail = "test" + System.currentTimeMillis() + "@example.com";
    final User user = userTestTools.createUser();
    user.setEmail(userEmail);
    userTestTools.save(user);
    // Attempt to load
    final UserDetails userDetails = customUserDetailsService.loadUserByUsername(userEmail);
    // Verify
    assertNotNull("Result should be non-null", userDetails);
    assertTrue("Should be a CustomUserDetails instance", userDetails instanceof CustomUserDetails);
    assertEquals("Should have correct email", userEmail, userDetails.getUsername());
    assertEquals("Should have correct id",  user.getId(), ((CustomUserDetails) userDetails).getUserId());
    assertNotNull("Should have a user model", ((CustomUserDetails) userDetails).getUserModel());
}