use of com.djrapitops.plan.storage.database.transactions.events.NicknameStoreTransaction in project Plan by plan-player-analytics.
the class NicknameQueriesTest method allNicknamesAreSaved.
@Test
default void allNicknamesAreSaved() {
db().executeTransaction(new PlayerServerRegisterTransaction(playerUUID, RandomData::randomTime, TestConstants.PLAYER_ONE_NAME, serverUUID(), TestConstants.GET_PLAYER_HOSTNAME));
List<Nickname> saved = RandomData.randomNicknames(serverUUID());
for (Nickname nickname : saved) {
db().executeTransaction(new NicknameStoreTransaction(playerUUID, nickname, (uuid, name) -> false));
db().executeTransaction(new NicknameStoreTransaction(playerUUID, nickname, (uuid, name) -> true));
}
forcePersistenceCheck();
List<Nickname> fetched = db().query(NicknameQueries.fetchNicknameDataOfPlayer(playerUUID));
assertEquals(saved, fetched);
}
Aggregations