aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-06-11 08:28:41 -0700
committerAnton Tananaev <anton@traccar.org>2022-06-11 08:28:41 -0700
commita401b40ee3b69d5679031a1e1d7287a0a56f4160 (patch)
tree30b0a1dfdc6b396dcb12947f19307b749e531446 /src/test
parent5b269c0e309b70866ad167fb148eafcbad5a8b26 (diff)
downloadtrackermap-server-a401b40ee3b69d5679031a1e1d7287a0a56f4160.tar.gz
trackermap-server-a401b40ee3b69d5679031a1e1d7287a0a56f4160.tar.bz2
trackermap-server-a401b40ee3b69d5679031a1e1d7287a0a56f4160.zip
Inject velocity engine
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/org/traccar/reports/ReportUtilsTest.java37
1 files changed, 19 insertions, 18 deletions
diff --git a/src/test/java/org/traccar/reports/ReportUtilsTest.java b/src/test/java/org/traccar/reports/ReportUtilsTest.java
index 92bfdae1c..1440c4c30 100644
--- a/src/test/java/org/traccar/reports/ReportUtilsTest.java
+++ b/src/test/java/org/traccar/reports/ReportUtilsTest.java
@@ -1,5 +1,6 @@
package org.traccar.reports;
+import org.apache.velocity.app.VelocityEngine;
import org.junit.Test;
import org.traccar.BaseTest;
import org.traccar.api.security.PermissionsService;
@@ -76,8 +77,8 @@ public class ReportUtilsTest extends BaseTest {
@Test
public void testCalculateSpentFuel() {
ReportUtils reportUtils = new ReportUtils(
- mock(Config.class), mock(Storage.class), mock(PermissionsService.class),
- mockIdentityManager(), mock(DeviceManager.class), mock(TripsConfig.class), null);
+ mock(Config.class), mock(Storage.class), mock(PermissionsService.class), mockIdentityManager(),
+ mock(DeviceManager.class), mock(TripsConfig.class), mock(VelocityEngine.class), null);
Position startPosition = new Position();
Position endPosition = new Position();
assertEquals(reportUtils.calculateFuel(startPosition, endPosition), 0.0, 0.01);
@@ -101,8 +102,8 @@ public class ReportUtilsTest extends BaseTest {
TripsConfig tripsConfig = new TripsConfig(500, 300000, 180000, 900000, false, false, 0.01);
ReportUtils reportUtils = new ReportUtils(
- mock(Config.class), mock(Storage.class), mock(PermissionsService.class),
- mockIdentityManager(), mock(DeviceManager.class), tripsConfig, null);
+ mock(Config.class), mock(Storage.class), mock(PermissionsService.class), mockIdentityManager(),
+ mock(DeviceManager.class), tripsConfig, mock(VelocityEngine.class), null);
Collection<TripReportItem> trips = reportUtils.detectTripsAndStops(data, false, TripReportItem.class);
@@ -156,8 +157,8 @@ public class ReportUtilsTest extends BaseTest {
TripsConfig tripsConfig = new TripsConfig(500, 300000, 180000, 900000, true, false, 0.01);
ReportUtils reportUtils = new ReportUtils(
- mock(Config.class), mock(Storage.class), mock(PermissionsService.class),
- mockIdentityManager(), mock(DeviceManager.class), tripsConfig, null);
+ mock(Config.class), mock(Storage.class), mock(PermissionsService.class), mockIdentityManager(),
+ mock(DeviceManager.class), tripsConfig, mock(VelocityEngine.class), null);
Collection<TripReportItem> trips = reportUtils.detectTripsAndStops(data, false, TripReportItem.class);
@@ -227,8 +228,8 @@ public class ReportUtilsTest extends BaseTest {
TripsConfig tripsConfig = new TripsConfig(500, 300000, 180000, 900000, false, false, 0.01);
ReportUtils reportUtils = new ReportUtils(
- mock(Config.class), mock(Storage.class), mock(PermissionsService.class),
- mockIdentityManager(), mock(DeviceManager.class), tripsConfig, null);
+ mock(Config.class), mock(Storage.class), mock(PermissionsService.class), mockIdentityManager(),
+ mock(DeviceManager.class), tripsConfig, mock(VelocityEngine.class), null);
Collection<TripReportItem> trips = reportUtils.detectTripsAndStops(data, false, TripReportItem.class);
@@ -278,8 +279,8 @@ public class ReportUtilsTest extends BaseTest {
TripsConfig tripsConfig = new TripsConfig(500, 300000, 200000, 900000, false, false, 0.01);
ReportUtils reportUtils = new ReportUtils(
- mock(Config.class), mock(Storage.class), mock(PermissionsService.class),
- mockIdentityManager(), mock(DeviceManager.class), tripsConfig, null);
+ mock(Config.class), mock(Storage.class), mock(PermissionsService.class), mockIdentityManager(),
+ mock(DeviceManager.class), tripsConfig, mock(VelocityEngine.class), null);
Collection<StopReportItem> result = reportUtils.detectTripsAndStops(data, false, StopReportItem.class);
@@ -307,8 +308,8 @@ public class ReportUtilsTest extends BaseTest {
TripsConfig tripsConfig = new TripsConfig(500, 300000, 200000, 900000, false, false, 0.01);
ReportUtils reportUtils = new ReportUtils(
- mock(Config.class), mock(Storage.class), mock(PermissionsService.class),
- mockIdentityManager(), mock(DeviceManager.class), tripsConfig, null);
+ mock(Config.class), mock(Storage.class), mock(PermissionsService.class), mockIdentityManager(),
+ mock(DeviceManager.class), tripsConfig, mock(VelocityEngine.class), null);
Collection<StopReportItem> result = reportUtils.detectTripsAndStops(data, false, StopReportItem.class);
@@ -336,8 +337,8 @@ public class ReportUtilsTest extends BaseTest {
TripsConfig tripsConfig = new TripsConfig(500, 300000, 200000, 900000, false, false, 0.01);
ReportUtils reportUtils = new ReportUtils(
- mock(Config.class), mock(Storage.class), mock(PermissionsService.class),
- mockIdentityManager(), mock(DeviceManager.class), tripsConfig, null);
+ mock(Config.class), mock(Storage.class), mock(PermissionsService.class), mockIdentityManager(),
+ mock(DeviceManager.class), tripsConfig, mock(VelocityEngine.class), null);
Collection<StopReportItem> result = reportUtils.detectTripsAndStops(data, false, StopReportItem.class);
@@ -365,8 +366,8 @@ public class ReportUtilsTest extends BaseTest {
TripsConfig tripsConfig = new TripsConfig(500, 300000, 200000, 900000, false, false, 0.01);
ReportUtils reportUtils = new ReportUtils(
- mock(Config.class), mock(Storage.class), mock(PermissionsService.class),
- mockIdentityManager(), mock(DeviceManager.class), tripsConfig, null);
+ mock(Config.class), mock(Storage.class), mock(PermissionsService.class), mockIdentityManager(),
+ mock(DeviceManager.class), tripsConfig, mock(VelocityEngine.class), null);
Collection<StopReportItem> result = reportUtils.detectTripsAndStops(data, false, StopReportItem.class);
@@ -390,8 +391,8 @@ public class ReportUtilsTest extends BaseTest {
TripsConfig tripsConfig = new TripsConfig(500, 200000, 200000, 900000, false, false, 0.01);
ReportUtils reportUtils = new ReportUtils(
- mock(Config.class), mock(Storage.class), mock(PermissionsService.class),
- mockIdentityManager(), mock(DeviceManager.class), tripsConfig, null);
+ mock(Config.class), mock(Storage.class), mock(PermissionsService.class), mockIdentityManager(),
+ mock(DeviceManager.class), tripsConfig, mock(VelocityEngine.class), null);
Collection<TripReportItem> trips = reportUtils.detectTripsAndStops(data, false, TripReportItem.class);