aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-06-18 10:08:52 -0700
committerAnton Tananaev <anton@traccar.org>2022-06-18 10:08:52 -0700
commit22bd8bcc80b850dc2308be50cf2886c39b0655da (patch)
tree01f98cf67e21f06f94f85b8cc38ae63b8ec39df9 /src/test/java/org/traccar
parentc248ed30047a0525bf792730a0fbd4de0c89ad8e (diff)
downloadtrackermap-server-22bd8bcc80b850dc2308be50cf2886c39b0655da.tar.gz
trackermap-server-22bd8bcc80b850dc2308be50cf2886c39b0655da.tar.bz2
trackermap-server-22bd8bcc80b850dc2308be50cf2886c39b0655da.zip
Refactor device password
Diffstat (limited to 'src/test/java/org/traccar')
-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);