2222import static com .jcabi .matchers .RegexMatchers .matchesPattern ;
2323import static com .maxmind .minfraud .request .RequestTestHelper .*;
2424import static org .hamcrest .core .StringStartsWith .startsWith ;
25+ import static org .junit .Assert .assertFalse ;
26+ import static org .junit .Assert .assertTrue ;
2527
2628@ RunWith (JUnitParamsRunner .class )
2729public class WebServiceClientTest {
@@ -68,6 +70,15 @@ public void testFullInsightsTransaction() throws Exception {
6870 // We cannot change this as it would be a breaking change to the GeoIP2 API.
6971 JSONAssert .assertEquals (responseContent , response .toJson (), false );
7072 verifyRequestFor ("insights" , "full-request" );
73+ assertTrue (
74+ "response.getIpAddress().getCountry().isInEuropeanUnion() does not return true" ,
75+ response .getIpAddress ().getCountry ().isInEuropeanUnion ());
76+ assertFalse (
77+ "response.getIpAddress().getRegisteredCountry().isInEuropeanUnion() does not return false" ,
78+ response .getIpAddress ().getRegisteredCountry ().isInEuropeanUnion ());
79+ assertTrue (
80+ "response.getIpAddress().getRepresentedCountry().isInEuropeanUnion() does not return true" ,
81+ response .getIpAddress ().getRepresentedCountry ().isInEuropeanUnion ());
7182 }
7283 }
7384
@@ -83,6 +94,15 @@ public void testFullFactorsTransaction() throws Exception {
8394 // We cannot change this as it would be a breaking change to the GeoIP2 API.
8495 JSONAssert .assertEquals (responseContent , response .toJson (), false );
8596 verifyRequestFor ("factors" , "full-request" );
97+ assertTrue (
98+ "response.getIpAddress().getCountry().isInEuropeanUnion() does not return true" ,
99+ response .getIpAddress ().getCountry ().isInEuropeanUnion ());
100+ assertTrue (
101+ "response.getIpAddress().getRegisteredCountry().isInEuropeanUnion() does not return true" ,
102+ response .getIpAddress ().getRegisteredCountry ().isInEuropeanUnion ());
103+ assertFalse (
104+ "response.getIpAddress().getRepresentedCountry().isInEuropeanUnion() does not return false" ,
105+ response .getIpAddress ().getRepresentedCountry ().isInEuropeanUnion ());
86106 }
87107 }
88108
0 commit comments