diff --git a/Plan/common/src/test/java/com/djrapitops/plan/storage/database/queries/PingQueriesTest.java b/Plan/common/src/test/java/com/djrapitops/plan/storage/database/queries/PingQueriesTest.java index 8ccb032fc..21df9b0ec 100644 --- a/Plan/common/src/test/java/com/djrapitops/plan/storage/database/queries/PingQueriesTest.java +++ b/Plan/common/src/test/java/com/djrapitops/plan/storage/database/queries/PingQueriesTest.java @@ -31,6 +31,7 @@ import utilities.RandomData; import utilities.TestConstants; import java.util.*; +import java.util.concurrent.ExecutionException; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -71,14 +72,14 @@ public interface PingQueriesTest extends DatabaseTestPreparer { } @Test - default void singlePingIsStored() { + default void singlePingIsStored() throws ExecutionException, InterruptedException { prepareForPingStorage(); - DateObj saved = RandomData.randomIntDateObject(); + DateObj saved = RandomData.randomIntDateObject(1, 4001); // accepted ping range 1-4000 ms int value = saved.getValue(); db().executeTransaction(new PingStoreTransaction(playerUUID, serverUUID(), Collections.singletonList(saved) - )); + )).get(); Map> expected = Collections.singletonMap(playerUUID, Collections.singletonList( new Ping(saved.getDate(), serverUUID(), value, value, value) )); diff --git a/Plan/common/src/test/java/utilities/RandomData.java b/Plan/common/src/test/java/utilities/RandomData.java index d7847926b..83351dfce 100644 --- a/Plan/common/src/test/java/utilities/RandomData.java +++ b/Plan/common/src/test/java/utilities/RandomData.java @@ -201,6 +201,10 @@ public class RandomData { return new DateObj<>(randomTime(), randomInt(0, 500)); } + public static DateObj randomIntDateObject(int rangeStart, int rangeEnd) { + return new DateObj<>(randomTime(), randomInt(rangeStart, rangeEnd)); + } + public static double randomDouble() { return ThreadLocalRandom.current().nextDouble(); }