aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-04-17 17:30:16 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2017-04-17 17:30:16 +1200
commita1d91f3b8a80758d5f3e7804afec66256ab27e68 (patch)
treed159aa429629922eb5b8dea74657058fa8cf5acf /test
parent136a302846ad340f6babaa5f0f35018d867f73e8 (diff)
downloadtraccar-server-a1d91f3b8a80758d5f3e7804afec66256ab27e68.tar.gz
traccar-server-a1d91f3b8a80758d5f3e7804afec66256ab27e68.tar.bz2
traccar-server-a1d91f3b8a80758d5f3e7804afec66256ab27e68.zip
Remove unused imports and fix tests
Diffstat (limited to 'test')
-rw-r--r--test/org/traccar/reports/ReportUtilsTest.java13
1 files changed, 4 insertions, 9 deletions
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");
}
}