mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-12 15:56:00 +08:00
Change GeolocationCacheTest
This commit is contained in:
parent
bdb4b4ffbe
commit
521950804c
@ -56,7 +56,10 @@ public class GeolocationCacheTest {
|
||||
public void testCaching() throws Exception {
|
||||
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);
|
||||
assertFalse(GeolocationCacheHandler.isCached(ip));
|
||||
|
||||
@ -64,7 +67,10 @@ public class GeolocationCacheTest {
|
||||
assertTrue(GeolocationCacheHandler.isCached(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