|
|
|
@ -49,7 +49,7 @@ public class DeviceActorMessageProcessorTest { |
|
|
|
public void setUp() { |
|
|
|
systemContext = mock(ActorSystemContext.class); |
|
|
|
deviceService = mock(DeviceService.class); |
|
|
|
willReturn(MAX_CONCURRENT_SESSIONS_PER_DEVICE).given(systemContext).getMaxConcurrentSessionsPerDevice(); |
|
|
|
willReturn((long)MAX_CONCURRENT_SESSIONS_PER_DEVICE).given(systemContext).getMaxConcurrentSessionsPerDevice(); |
|
|
|
willReturn(deviceService).given(systemContext).getDeviceService(); |
|
|
|
processor = new DeviceActorMessageProcessor(systemContext, tenantId, deviceId); |
|
|
|
willReturn(mock(TbCoreToTransportService.class)).given(systemContext).getTbCoreToTransportService(); |
|
|
|
@ -58,7 +58,7 @@ public class DeviceActorMessageProcessorTest { |
|
|
|
@Test |
|
|
|
public void givenSystemContext_whenNewInstance_thenVerifySessionMapMaxSize() { |
|
|
|
assertThat(processor.sessions, instanceOf(LinkedHashMapRemoveEldest.class)); |
|
|
|
assertThat(processor.sessions.getMaxEntries(), is(MAX_CONCURRENT_SESSIONS_PER_DEVICE)); |
|
|
|
assertThat(processor.sessions.getMaxEntries(), is((long)MAX_CONCURRENT_SESSIONS_PER_DEVICE)); |
|
|
|
assertThat(processor.sessions.getRemovalConsumer(), notNullValue()); |
|
|
|
} |
|
|
|
|
|
|
|
|