Refactor: fixed tests after fixing merge conflicts

This commit is contained in:
Dmytro Skarzhynets 2023-05-02 17:08:35 +03:00
parent 6266f6763e
commit 3b405ccd84
4 changed files with 7 additions and 7 deletions

View File

@ -257,7 +257,7 @@ public class TbGetCustomerAttributeNodeTest {
when(ctxMock.getTenantId()).thenReturn(TENANT_ID); when(ctxMock.getTenantId()).thenReturn(TENANT_ID);
when(ctxMock.getDeviceService()).thenReturn(deviceServiceMock); when(ctxMock.getDeviceService()).thenReturn(deviceServiceMock);
doReturn(Futures.immediateFuture(device)).when(deviceServiceMock).findDeviceByIdAsync(eq(TENANT_ID), eq(device.getId())); doReturn(device).when(deviceServiceMock).findDeviceById(eq(TENANT_ID), eq(device.getId()));
when(ctxMock.getAttributesService()).thenReturn(attributesServiceMock); when(ctxMock.getAttributesService()).thenReturn(attributesServiceMock);
when(attributesServiceMock.find(eq(TENANT_ID), eq(CUSTOMER_ID), eq(SERVER_SCOPE), argThat(new ListMatcher<>(expectedPatternProcessedKeysList)))) when(attributesServiceMock.find(eq(TENANT_ID), eq(CUSTOMER_ID), eq(SERVER_SCOPE), argThat(new ListMatcher<>(expectedPatternProcessedKeysList))))

View File

@ -178,7 +178,7 @@ public class TbGetOriginatorFieldsNodeTest {
when(ctxMock.getDeviceService()).thenReturn(deviceServiceMock); when(ctxMock.getDeviceService()).thenReturn(deviceServiceMock);
when(ctxMock.getTenantId()).thenReturn(DUMMY_TENANT_ID); when(ctxMock.getTenantId()).thenReturn(DUMMY_TENANT_ID);
when(deviceServiceMock.findDeviceByIdAsync(eq(DUMMY_TENANT_ID), eq(device.getId()))).thenReturn(Futures.immediateFuture(device)); when(deviceServiceMock.findDeviceById(eq(DUMMY_TENANT_ID), eq(device.getId()))).thenReturn(device);
when(ctxMock.getDbCallbackExecutor()).thenReturn(DB_EXECUTOR); when(ctxMock.getDbCallbackExecutor()).thenReturn(DB_EXECUTOR);
@ -221,7 +221,7 @@ public class TbGetOriginatorFieldsNodeTest {
when(ctxMock.getDeviceService()).thenReturn(deviceServiceMock); when(ctxMock.getDeviceService()).thenReturn(deviceServiceMock);
when(ctxMock.getTenantId()).thenReturn(DUMMY_TENANT_ID); when(ctxMock.getTenantId()).thenReturn(DUMMY_TENANT_ID);
when(deviceServiceMock.findDeviceByIdAsync(eq(DUMMY_TENANT_ID), eq(device.getId()))).thenReturn(Futures.immediateFuture(device)); when(deviceServiceMock.findDeviceById(eq(DUMMY_TENANT_ID), eq(device.getId()))).thenReturn(device);
when(ctxMock.getDbCallbackExecutor()).thenReturn(DB_EXECUTOR); when(ctxMock.getDbCallbackExecutor()).thenReturn(DB_EXECUTOR);
@ -269,7 +269,7 @@ public class TbGetOriginatorFieldsNodeTest {
when(ctxMock.getDeviceService()).thenReturn(deviceServiceMock); when(ctxMock.getDeviceService()).thenReturn(deviceServiceMock);
when(ctxMock.getTenantId()).thenReturn(DUMMY_TENANT_ID); when(ctxMock.getTenantId()).thenReturn(DUMMY_TENANT_ID);
when(deviceServiceMock.findDeviceByIdAsync(eq(DUMMY_TENANT_ID), eq(device.getId()))).thenReturn(Futures.immediateFuture(device)); when(deviceServiceMock.findDeviceById(eq(DUMMY_TENANT_ID), eq(device.getId()))).thenReturn(device);
when(ctxMock.getDbCallbackExecutor()).thenReturn(DB_EXECUTOR); when(ctxMock.getDbCallbackExecutor()).thenReturn(DB_EXECUTOR);

View File

@ -140,7 +140,7 @@ public class EntitiesCustomerIdAsyncLoaderTest {
device.setCustomerId(expectedCustomerId); device.setCustomerId(expectedCustomerId);
when(ctxMock.getDeviceService()).thenReturn(deviceServiceMock); when(ctxMock.getDeviceService()).thenReturn(deviceServiceMock);
doReturn(Futures.immediateFuture(device)).when(deviceServiceMock).findDeviceByIdAsync(any(), any()); doReturn(device).when(deviceServiceMock).findDeviceById(any(), any());
when(ctxMock.getDbCallbackExecutor()).thenReturn(DB_EXECUTOR); when(ctxMock.getDbCallbackExecutor()).thenReturn(DB_EXECUTOR);
// WHEN // WHEN

View File

@ -214,11 +214,11 @@ public class EntitiesFieldsAsyncLoaderTest {
break; break;
case DEVICE: case DEVICE:
var device = Futures.immediateFuture(entityDoesNotExist ? null : new Device(new DeviceId(RANDOM_UUID))); var device = entityDoesNotExist ? null : new Device(new DeviceId(RANDOM_UUID));
when(ctxMock.getDbCallbackExecutor()).thenReturn(DB_EXECUTOR); when(ctxMock.getDbCallbackExecutor()).thenReturn(DB_EXECUTOR);
when(ctxMock.getDeviceService()).thenReturn(deviceServiceMock); when(ctxMock.getDeviceService()).thenReturn(deviceServiceMock);
doReturn(device).when(deviceServiceMock).findDeviceByIdAsync(eq(TENANT_ID), any()); doReturn(device).when(deviceServiceMock).findDeviceById(eq(TENANT_ID), any());
break; break;
case ALARM: case ALARM: