Fixed spring-mvc-java, spring-cloud-rest-discovery-server apache-solr… (#4661)
* Fixed spring-mvc-java, spring-cloud-rest-discovery-server apache-solrj integration tests * Fixed integration tests for spring-hibernate-3, spring-jooq module
This commit is contained in:
committed by
Grzegorz Piwowarek
parent
f959cbe55a
commit
d9d8f169eb
@@ -14,10 +14,12 @@ public class GeoIpIntegrationTest {
|
||||
|
||||
@Test
|
||||
public void givenIP_whenFetchingCity_thenReturnsCityData() throws IOException, GeoIp2Exception {
|
||||
File database = new File("your-path-to-db-file");
|
||||
|
||||
ClassLoader classLoader = getClass().getClassLoader();
|
||||
File database = new File(classLoader.getResource("GeoLite2-City.mmdb").getFile());
|
||||
DatabaseReader dbReader = new DatabaseReader.Builder(database).build();
|
||||
|
||||
InetAddress ipAddress = InetAddress.getByName("your-public-ip");
|
||||
InetAddress ipAddress = InetAddress.getByName("google.com");
|
||||
CityResponse response = dbReader.city(ipAddress);
|
||||
|
||||
String countryName = response.getCountry().getName();
|
||||
|
||||
13
spring-mvc-xml/src/test/resources/.gitignore
vendored
13
spring-mvc-xml/src/test/resources/.gitignore
vendored
@@ -1,13 +0,0 @@
|
||||
*.class
|
||||
|
||||
#folders#
|
||||
/target
|
||||
/neoDb*
|
||||
/data
|
||||
/src/main/webapp/WEB-INF/classes
|
||||
*/META-INF/*
|
||||
|
||||
# Packaged files #
|
||||
*.jar
|
||||
*.war
|
||||
*.ear
|
||||
BIN
spring-mvc-xml/src/test/resources/GeoLite2-City.mmdb
Normal file
BIN
spring-mvc-xml/src/test/resources/GeoLite2-City.mmdb
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 54 MiB |
Reference in New Issue
Block a user