From a1d91f3b8a80758d5f3e7804afec66256ab27e68 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 17 Apr 2017 17:30:16 +1200 Subject: Remove unused imports and fix tests --- test/org/traccar/reports/ReportUtilsTest.java | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'test') diff --git a/test/org/traccar/reports/ReportUtilsTest.java b/test/org/traccar/reports/ReportUtilsTest.java index f4dd88cba..2f785c538 100644 --- a/test/org/traccar/reports/ReportUtilsTest.java +++ b/test/org/traccar/reports/ReportUtilsTest.java @@ -22,15 +22,10 @@ public class ReportUtilsTest { public void testCalculateSpentFuel() { Position startPosition = new Position(); Position endPosition = new Position(); - Assert.assertEquals(ReportUtils.calculateFuel(startPosition, endPosition), "-"); - startPosition.setProtocol("meitrack"); - startPosition.set(Position.KEY_FUEL_LEVEL, 0.07); - endPosition.set(Position.KEY_FUEL_LEVEL, 0.05); - Assert.assertEquals(ReportUtils.calculateFuel(startPosition, endPosition), "0.02 %"); - startPosition.setProtocol("galileo"); - Assert.assertEquals(ReportUtils.calculateFuel(startPosition, endPosition), "0.02 %"); - startPosition.setProtocol("noran"); - Assert.assertEquals(ReportUtils.calculateFuel(startPosition, endPosition), "0.02 %"); + Assert.assertNull(ReportUtils.calculateFuel(startPosition, endPosition)); + startPosition.set(Position.KEY_FUEL_LEVEL, 0.7); + endPosition.set(Position.KEY_FUEL_LEVEL, 0.5); + Assert.assertEquals(ReportUtils.calculateFuel(startPosition, endPosition), "0.2"); } } -- cgit v1.2.3