@Test()
public void testLoadUserByUsername_when_account_is_lockout_verify_that_lockout_flag_is_set() {

	Users user = mock(Users.class);
	when(usersRepository.loadUserByUsername(username)).thenReturn(user);
	when(user.getFailedLoginAttempts()).thenReturn(5);
	when(user.getLockoutTime()).thenReturn(Calendar.getInstance());
	assertEquals(accountUserDetailsService.loadUserByUsername(username),
			user);
	verify(user).setAccountNonLocked(false);
}