aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/org
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/java/org')
-rw-r--r--src/test/java/org/traccar/BaseTest.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/test/java/org/traccar/BaseTest.java b/src/test/java/org/traccar/BaseTest.java
index add423cdd..54035553f 100644
--- a/src/test/java/org/traccar/BaseTest.java
+++ b/src/test/java/org/traccar/BaseTest.java
@@ -66,9 +66,11 @@ public class BaseTest {
var device = mock(Device.class);
when(device.getId()).thenReturn(1L);
when(device.getUniqueId()).thenReturn("123456789012345");
+ var cacheManager = mock(CacheManager.class);
+ when(cacheManager.getConfig()).thenReturn(mock(Config.class));
+ when(cacheManager.getObject(eq(Device.class), anyLong())).thenReturn(device);
+ encoder.setCacheManager(cacheManager);
var identityManager = mock(IdentityManager.class);
- when(identityManager.getDevicePassword(anyLong(), any(), any()))
- .thenAnswer(invocation -> invocation.getArguments()[2]);
when(identityManager.getById(anyLong())).thenReturn(device);
when(identityManager.getByUniqueId(any())).thenReturn(device);
encoder.setIdentityManager(identityManager);