use of games.strategy.engine.lobby.server.db.BadWordController in project triplea by triplea-game.
the class LobbyLoginValidatorIntegrationTest method testAnonymousLoginBadName.
@Test
public void testAnonymousLoginBadName() {
final String name = "bitCh" + Util.createUniqueTimeStamp();
try {
new BadWordController().addBadWord("bitCh");
} catch (final Exception ignore) {
// this is probably a duplicate insertion error, we can ignore that as it only means we already added the bad
// word previously
}
assertEquals(LobbyLoginValidator.ErrorMessages.THATS_NOT_A_NICE_NAME, generateChallenge(name, new HashedPassword(md5Crypt("foo"))).apply(challenge -> new HashMap<>(Collections.singletonMap(LobbyLoginValidator.ANONYMOUS_LOGIN, Boolean.TRUE.toString()))));
}
Aggregations