Skip to content

Commit c6dabb6

Browse files
committed
Add a test for Satellite connection type
1 parent 09fc96d commit c6dabb6

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.maxmind.minfraud.response;
22

33
import com.fasterxml.jackson.jr.ob.JSON;
4+
import com.maxmind.geoip2.model.ConnectionTypeResponse.ConnectionType;
45
import org.junit.Test;
56

67
import static org.junit.Assert.*;
@@ -30,6 +31,7 @@ public void testIpAddress() throws Exception {
3031
.put("local_time", time)
3132
.end()
3233
.startObjectField("traits")
34+
.put("connection_type", "Satellite")
3335
.put("ip_address", "1.2.3.4")
3436
.put("is_anonymous", true)
3537
.put("is_anonymous_vpn", true)
@@ -46,6 +48,7 @@ public void testIpAddress() throws Exception {
4648
assertEquals("correct local time", time, address.getLocation().getLocalTime());
4749
assertEquals("1.2.0.0/16", address.getTraits().getNetwork().toString());
4850
assertTrue("isHighRisk", address.getCountry().isHighRisk());
51+
assertEquals("getConnectionType", ConnectionType.SATELLITE, address.getTraits().getConnectionType());
4952
assertTrue("isAnonymous", address.getTraits().isAnonymous());
5053
assertTrue("isAnonymousVpn", address.getTraits().isAnonymousVpn());
5154
assertTrue("isHostingProvider", address.getTraits().isHostingProvider());
@@ -66,4 +69,4 @@ public void testEmptyObject() throws Exception {
6669

6770
assertNotNull(address.getRiskReasons());
6871
}
69-
}
72+
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@
9595
}
9696
],
9797
"traits": {
98+
"connection_type": "Satellite",
9899
"domain": "in-addr.arpa",
99100
"ip_address": "152.216.7.110",
100101
"is_anonymous": true,
@@ -192,4 +193,4 @@
192193
"warning": "Encountered value at \/account\/username_md5 that does meet the required constraints"
193194
}
194195
]
195-
}
196+
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@
109109
}
110110
],
111111
"traits": {
112+
"connection_type": "Satellite",
112113
"domain": "in-addr.arpa",
113114
"ip_address": "152.216.7.110",
114115
"is_anonymous": true,
@@ -186,4 +187,4 @@
186187
"warning": "Encountered value at \/account\/username_md5 that does meet the required constraints"
187188
}
188189
]
189-
}
190+
}

0 commit comments

Comments
 (0)