Search in sources :

Example 1 with ServerPlayerContainersQuery

use of com.djrapitops.plan.storage.database.queries.containers.ServerPlayerContainersQuery in project Plan by plan-player-analytics.

the class DatabaseTest method serverPlayerContainersQueryDoesNotReturnDuplicatePlayers.

@Test
default void serverPlayerContainersQueryDoesNotReturnDuplicatePlayers() {
    db().executeTransaction(TestData.storeServers());
    executeTransactions(TestData.storePlayerOneData());
    executeTransactions(TestData.storePlayerTwoData());
    List<UUID> expected = Arrays.asList(playerUUID, player2UUID);
    Collections.sort(expected);
    Collection<UUID> result = db().query(new ServerPlayerContainersQuery(TestConstants.SERVER_UUID)).stream().map(player -> player.getUnsafe(PlayerKeys.UUID)).sorted().collect(Collectors.toList());
    assertEquals(expected, result);
}
Also used : ServerPlayerContainersQuery(com.djrapitops.plan.storage.database.queries.containers.ServerPlayerContainersQuery) ServerUUID(com.djrapitops.plan.identification.ServerUUID) Test(org.junit.jupiter.api.Test)

Aggregations

ServerUUID (com.djrapitops.plan.identification.ServerUUID)1 ServerPlayerContainersQuery (com.djrapitops.plan.storage.database.queries.containers.ServerPlayerContainersQuery)1 Test (org.junit.jupiter.api.Test)1