mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-03-11 14:20:54 +01:00
Change GeolocationCacheTest
This commit is contained in:
parent
bdb4b4ffbe
commit
521950804c
@ -56,7 +56,10 @@ public class GeolocationCacheTest {
|
|||||||
public void testCaching() throws Exception {
|
public void testCaching() throws Exception {
|
||||||
TestInit.init();
|
TestInit.init();
|
||||||
|
|
||||||
for (String ip : ipsToCountries.keySet()) {
|
for (Map.Entry<String, String> entry : ipsToCountries.entrySet()) {
|
||||||
|
String ip = entry.getKey();
|
||||||
|
String expIp = entry.getValue();
|
||||||
|
|
||||||
String countryFirstCall = GeolocationCacheHandler.getUncachedCountry(ip);
|
String countryFirstCall = GeolocationCacheHandler.getUncachedCountry(ip);
|
||||||
assertFalse(GeolocationCacheHandler.isCached(ip));
|
assertFalse(GeolocationCacheHandler.isCached(ip));
|
||||||
|
|
||||||
@ -64,7 +67,10 @@ public class GeolocationCacheTest {
|
|||||||
assertTrue(GeolocationCacheHandler.isCached(ip));
|
assertTrue(GeolocationCacheHandler.isCached(ip));
|
||||||
|
|
||||||
String countryThirdCall = GeolocationCacheHandler.getCachedCountry(ip);
|
String countryThirdCall = GeolocationCacheHandler.getCachedCountry(ip);
|
||||||
assertEquals(countryFirstCall, countrySecondCall, countryThirdCall);
|
|
||||||
|
assertEquals(countryFirstCall, countrySecondCall);
|
||||||
|
assertEquals(countrySecondCall, countryThirdCall);
|
||||||
|
assertEquals(countryThirdCall, expIp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user