aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/org/traccar/reports/ReportUtils.java1
-rw-r--r--test/org/traccar/reports/ReportUtilsTest.java13
2 files changed, 4 insertions, 10 deletions
diff --git a/src/org/traccar/reports/ReportUtils.java b/src/org/traccar/reports/ReportUtils.java
index acc8e4e3b..84d3b3a77 100644
--- a/src/org/traccar/reports/ReportUtils.java
+++ b/src/org/traccar/reports/ReportUtils.java
@@ -26,7 +26,6 @@ import org.jxls.transform.Transformer;
import org.jxls.transform.poi.PoiTransformer;
import org.jxls.util.TransformerFactory;
import org.traccar.Context;
-import org.traccar.helper.Log;
import org.traccar.model.Position;
import java.io.IOException;
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");
}
}