diff options
Diffstat (limited to 'test/org/traccar/reports/ReportUtilsTest.java')
-rw-r--r-- | test/org/traccar/reports/ReportUtilsTest.java | 13 |
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 |