use of com.djrapitops.plan.gathering.domain.GeoInfo in project Plan by plan-player-analytics.
the class GeolocationQueriesTest method storeSpecificGeolocations.
default UUID[] storeSpecificGeolocations() {
UUID firstUuid = UUID.randomUUID();
UUID secondUuid = UUID.randomUUID();
UUID thirdUuid = UUID.randomUUID();
UUID fourthUuid = UUID.randomUUID();
UUID fifthUuid = UUID.randomUUID();
UUID sixthUuid = UUID.randomUUID();
UUID[] uuids = { firstUuid, secondUuid, thirdUuid, fourthUuid, fifthUuid, sixthUuid };
Database db = db();
for (UUID uuid : uuids) {
db.executeTransaction(new PlayerServerRegisterTransaction(uuid, () -> 0L, "", serverUUID(), TestConstants.GET_PLAYER_HOSTNAME));
}
save(firstUuid, new GeoInfo("Norway", 0));
save(firstUuid, new GeoInfo("Finland", 5));
save(secondUuid, new GeoInfo("Sweden", 0));
save(thirdUuid, new GeoInfo("Denmark", 0));
save(fourthUuid, new GeoInfo("Denmark", 0));
save(fifthUuid, new GeoInfo("Not Known", 0));
save(sixthUuid, new GeoInfo("Local Machine", 0));
return uuids;
}
use of com.djrapitops.plan.gathering.domain.GeoInfo in project Plan by plan-player-analytics.
the class GeolocationQueriesTest method geoInformationIsStored.
@Test
default void geoInformationIsStored() {
db().executeTransaction(new PlayerServerRegisterTransaction(playerUUID, RandomData::randomTime, TestConstants.PLAYER_ONE_NAME, serverUUID(), TestConstants.GET_PLAYER_HOSTNAME));
List<GeoInfo> expected = RandomData.randomGeoInfo();
for (GeoInfo geoInfo : expected) {
save(playerUUID, geoInfo);
}
forcePersistenceCheck();
List<GeoInfo> result = db().query(GeoInfoQueries.fetchAllGeoInformation()).get(playerUUID);
assertEquals(expected, result);
}
Aggregations