aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar/reports/ReportUtilsTest.java
diff options
context:
space:
mode:
authorChristoph Krey <c@ckrey.de>2018-04-16 10:45:11 +0200
committerGitHub <noreply@github.com>2018-04-16 10:45:11 +0200
commit3a602dd133b533cc69d5986d64a00fb3ed670f75 (patch)
tree97ff753db310a49ae7e53240b1db07fb8475679e /test/org/traccar/reports/ReportUtilsTest.java
parent232de5f0daef98f31b28d177d991fdbfa191f195 (diff)
parent6d4b8df25c7e942b9ad594db9444fe15bcb16be9 (diff)
downloadtrackermap-server-3a602dd133b533cc69d5986d64a00fb3ed670f75.tar.gz
trackermap-server-3a602dd133b533cc69d5986d64a00fb3ed670f75.tar.bz2
trackermap-server-3a602dd133b533cc69d5986d64a00fb3ed670f75.zip
Merge pull request #4 from traccar/master
upgrade to current master
Diffstat (limited to 'test/org/traccar/reports/ReportUtilsTest.java')
-rw-r--r--test/org/traccar/reports/ReportUtilsTest.java13
1 files changed, 5 insertions, 8 deletions
diff --git a/test/org/traccar/reports/ReportUtilsTest.java b/test/org/traccar/reports/ReportUtilsTest.java
index 4f7a4eb68..a8ff653c9 100644
--- a/test/org/traccar/reports/ReportUtilsTest.java
+++ b/test/org/traccar/reports/ReportUtilsTest.java
@@ -15,7 +15,6 @@ import java.util.Iterator;
import java.util.List;
import java.util.TimeZone;
-import org.junit.Assert;
import org.junit.Test;
import org.traccar.BaseTest;
import org.traccar.model.Position;
@@ -35,9 +34,7 @@ public class ReportUtilsTest extends BaseTest {
Position position = new Position();
- if (time != null) {
- position.setTime(date(time));
- }
+ position.setTime(date(time));
position.setValid(true);
position.setSpeed(speed);
position.set(Position.KEY_TOTAL_DISTANCE, totalDistance);
@@ -51,20 +48,20 @@ public class ReportUtilsTest extends BaseTest {
startPosition.set(Position.KEY_TOTAL_DISTANCE, 500.0);
Position endPosition = new Position();
endPosition.set(Position.KEY_TOTAL_DISTANCE, 700.0);
- Assert.assertEquals(ReportUtils.calculateDistance(startPosition, endPosition), 200.0, 10);
+ assertEquals(ReportUtils.calculateDistance(startPosition, endPosition), 200.0, 10);
startPosition.set(Position.KEY_ODOMETER, 50000);
endPosition.set(Position.KEY_ODOMETER, 51000);
- Assert.assertEquals(ReportUtils.calculateDistance(startPosition, endPosition), 1000.0, 10);
+ assertEquals(ReportUtils.calculateDistance(startPosition, endPosition), 1000.0, 10);
}
@Test
public void testCalculateSpentFuel() {
Position startPosition = new Position();
Position endPosition = new Position();
- Assert.assertEquals(ReportUtils.calculateFuel(startPosition, endPosition), 0.0, 0.01);
+ assertEquals(ReportUtils.calculateFuel(startPosition, endPosition), 0.0, 0.01);
startPosition.set(Position.KEY_FUEL_LEVEL, 0.7);
endPosition.set(Position.KEY_FUEL_LEVEL, 0.5);
- Assert.assertEquals(ReportUtils.calculateFuel(startPosition, endPosition), 0.2, 0.01);
+ assertEquals(ReportUtils.calculateFuel(startPosition, endPosition), 0.2, 0.01);
}
@Test