Skip to content

Commit 39ba6bc

Browse files
committed
Update geoip2 to 2.10.0 and add anonymizer tests
1 parent 2bc5e85 commit 39ba6bc

5 files changed

Lines changed: 30 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ CHANGELOG
1010
* `EMERCHANTPAY`
1111
* `HEARTLAND`
1212
* `PAYWAY`
13-
13+
* Updated `geoip2` dependency to add support for GeoIP2 Precision
14+
Insights anonymizer fields.
15+
1416
1.6.0 (2017-09-08)
1517
------------------
1618

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
<dependency>
5858
<groupId>com.maxmind.geoip2</groupId>
5959
<artifactId>geoip2</artifactId>
60-
<version>2.9.0</version>
60+
<version>2.10.0</version>
6161
</dependency>
6262
<dependency>
6363
<groupId>org.apache.httpcomponents</groupId>

src/test/java/com/maxmind/minfraud/response/IpAddressTest.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,26 @@ public void testIpAddress() throws Exception {
2424
.startObjectField("location")
2525
.put("local_time", time)
2626
.end()
27+
.startObjectField("traits")
28+
.put("ip_address", "1.2.3.4")
29+
.put("is_anonymous", true)
30+
.put("is_anonymous_vpn", true)
31+
.put("is_hosting_provider", true)
32+
.put("is_public_proxy", true)
33+
.put("is_tor_exit_node", true)
34+
.end()
2735
.end()
2836
.finish()
2937
);
3038

3139
assertEquals("IP risk", new Double(99), address.getRisk());
3240
assertEquals("correct local time", time, address.getLocation().getLocalTime());
3341
assertTrue("isHighRisk", address.getCountry().isHighRisk());
42+
assertTrue("isAnonymous", address.getTraits().isAnonymous());
43+
assertTrue("isAnonymousVpn", address.getTraits().isAnonymousVpn());
44+
assertTrue("isHostingProvider", address.getTraits().isHostingProvider());
45+
assertTrue("isPublicProxy", address.getTraits().isPublicProxy());
46+
assertTrue("isTorExitNode", address.getTraits().isTorExitNode());
47+
3448
}
3549
}

src/test/resources/test-data/factors-response.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,12 @@
8585
"traits": {
8686
"domain": "in-addr.arpa",
8787
"ip_address": "81.2.69.160",
88+
"is_anonymous": true,
89+
"is_anonymous_vpn": true,
90+
"is_hosting_provider": true,
91+
"is_public_proxy": true,
92+
"is_satellite_provider": true,
93+
"is_tor_exit_node": true,
8894
"isp": "Andrews & Arnold Ltd",
8995
"organization": "STONEHOUSE office network",
9096
"user_type": "government"

src/test/resources/test-data/insights-response.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,12 @@
8585
"traits": {
8686
"domain": "in-addr.arpa",
8787
"ip_address": "81.2.69.160",
88+
"is_anonymous": true,
89+
"is_anonymous_vpn": true,
90+
"is_hosting_provider": true,
91+
"is_public_proxy": true,
92+
"is_satellite_provider": true,
93+
"is_tor_exit_node": true,
8894
"isp": "Andrews & Arnold Ltd",
8995
"organization": "STONEHOUSE office network",
9096
"user_type": "government"

0 commit comments

Comments
 (0)