IpUtils { @SuppressWarnings("unchecked") public static Map<String, String> getAllInfo(String ip) { if (StringUtils.isEmpty(ip)) { logger.error("ip is null!!!"); return Collections.emptyMap(); } String message; try { message = HttpUtils.get(String.format(REQUEST_URL, ip)); } catch (IOException e) { logger.error(e.getMessage(), e); return Collections.emptyMap(); } Map<String, Object> object = JsonConverterFactory.getConverter(JsonConverterFactory.JsonMode.JACKSON).toMap(message); Object result = object.get("code"); if (result != null && "0".equals(result.toString())) { logger.debug("get from '{}' success!", REQUEST_URL); return (Map<String, String>) object.get("data"); } else { logger.error("get from '{}' failure!", REQUEST_URL); return Collections.emptyMap(); } } private  IpUtils(); @SuppressWarnings("unchecked") static Map<String, String> getAllInfo(String ip); static String getCountry(String ip); static String getArea(String ip); static String getRegion(String ip); static String getCity(String ip); static String getIsp(String ip); static String getCounty(String ip); static String get(String ip, IpKey key); static String getInetIp(); static List<String> getInetIps();  }
@Test public void testGetAllInfo() { Assert.assertNotNull(IpUtils.getAllInfo("180.97.33.107")); }