use of com.faforever.server.entity.BanDetails in project faf-java-server by FAForever.
the class FafUserDetailsTest method userWithValidBanDetailsIsLocked.
@Test
public void userWithValidBanDetailsIsLocked() throws Exception {
User user = (User) new User().setPassword(TEST_PASSWORD).setBanDetails(new BanDetails().setExpiresAt(Timestamp.from(Instant.now().plus(1, ChronoUnit.HOURS)))).setLogin(TEST_USERNAME);
FafUserDetails fafUserDetails = new FafUserDetails(user);
assertThat(fafUserDetails.isAccountNonLocked(), is(false));
}
use of com.faforever.server.entity.BanDetails in project faf-java-server by FAForever.
the class FafUserDetailsTest method userWithExpiredBanDetailsIsNonLocked.
@Test
public void userWithExpiredBanDetailsIsNonLocked() throws Exception {
User user = (User) new User().setPassword(TEST_PASSWORD).setBanDetails(new BanDetails().setExpiresAt(Timestamp.from(Instant.now().minusSeconds(1)))).setLogin(TEST_USERNAME);
FafUserDetails fafUserDetails = new FafUserDetails(user);
assertThat(fafUserDetails.isAccountNonLocked(), is(true));
}
Aggregations