Add test
This commit is contained in:
parent
a0f7389857
commit
a743e770ce
2 changed files with 25 additions and 0 deletions
6
pom.xml
6
pom.xml
|
@ -57,6 +57,12 @@
|
||||||
<artifactId>json</artifactId>
|
<artifactId>json</artifactId>
|
||||||
<version>20240303</version>
|
<version>20240303</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.junit.jupiter</groupId>
|
||||||
|
<artifactId>junit-jupiter-engine</artifactId>
|
||||||
|
<version>5.11.3</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
|
19
src/test/java/com/lbry/globe/tests/GeoIPTest.java
Normal file
19
src/test/java/com/lbry/globe/tests/GeoIPTest.java
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
package com.lbry.globe.tests;
|
||||||
|
|
||||||
|
import com.lbry.globe.util.GeoIP;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
|
||||||
|
|
||||||
|
public class GeoIPTest{
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testGetCoordinateFromLocation(){
|
||||||
|
assertArrayEquals(new Double[]{123.0,456.0},GeoIP.getCoordinateFromLocation("123,456"));
|
||||||
|
assertArrayEquals(new Double[]{123.125,456.125},GeoIP.getCoordinateFromLocation("123.125,456.125"));
|
||||||
|
assertArrayEquals(new Double[]{123.25,456.25},GeoIP.getCoordinateFromLocation("123.25,456.25"));
|
||||||
|
assertArrayEquals(new Double[]{123.5,456.5},GeoIP.getCoordinateFromLocation("123.5,456.5"));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue