Tests are fixed

Signed-off-by: Oleksandra Matviienko <al.zzzeebra@gmail.com>
This commit is contained in:
Oleksandra Matviienko 2025-02-26 12:11:12 +01:00
parent 1b0b10a15a
commit 605fa385c9

View File

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