@Test public void sidnIPNetmaskASN() throws UnknownHostException { InetAddress addr = InetAddress.getByAddress(IPUtil.ipv4tobytes("94.198.159")); String country = geo.lookupCountry(addr); Assert.assertEquals("NL", country); addr = InetAddress.getByAddress(IPUtil.ipv6tobytes("2a00:d78::147:94:198:152")); country = geo.lookupCountry(addr); Assert.assertEquals("NL", country); }
@Test public void sidnIPASN() throws UnknownHostException { InetAddress addr = InetAddress.getByAddress(IPUtil.ipv4tobytes("94.198.159")); String asn = geo.lookupASN(addr, true); Assert.assertEquals("AS1140", asn); }