refactoring: tests fix bug testSaveEntityView
This commit is contained in:
parent
2301a918a7
commit
d0d47f96db
@ -815,6 +815,7 @@ public abstract class BaseDeviceControllerTest extends AbstractControllerTest {
|
|||||||
ActionType.ADDED, ActionType.ASSIGNED_TO_CUSTOMER, cntEntity, cntEntity, cntEntity * 2);
|
ActionType.ADDED, ActionType.ASSIGNED_TO_CUSTOMER, cntEntity, cntEntity, cntEntity * 2);
|
||||||
Mockito.reset(tbClusterService, auditLogService, gatewayNotificationsService);
|
Mockito.reset(tbClusterService, auditLogService, gatewayNotificationsService);
|
||||||
testNotificationUpdateGatewayNever();
|
testNotificationUpdateGatewayNever();
|
||||||
|
Mockito.reset(tbClusterService, auditLogService, gatewayNotificationsService);
|
||||||
|
|
||||||
List<Device> loadedDevices = new ArrayList<>(cntEntity);
|
List<Device> loadedDevices = new ArrayList<>(cntEntity);
|
||||||
PageLink pageLink = new PageLink(23);
|
PageLink pageLink = new PageLink(23);
|
||||||
@ -829,8 +830,6 @@ public abstract class BaseDeviceControllerTest extends AbstractControllerTest {
|
|||||||
|
|
||||||
assertThat(devices).containsExactlyInAnyOrderElementsOf(loadedDevices);
|
assertThat(devices).containsExactlyInAnyOrderElementsOf(loadedDevices);
|
||||||
|
|
||||||
Mockito.reset(tbClusterService, auditLogService, gatewayNotificationsService);
|
|
||||||
|
|
||||||
deleteEntitiesAsync("/api/customer/device/", loadedDevices, executor).get(TIMEOUT, TimeUnit.SECONDS);
|
deleteEntitiesAsync("/api/customer/device/", loadedDevices, executor).get(TIMEOUT, TimeUnit.SECONDS);
|
||||||
|
|
||||||
testNotifyManyEntityManyTimeMsgToEdgeServiceEntityEqAnyAdditionalInfoAny(new Device(), new Device(),
|
testNotifyManyEntityManyTimeMsgToEdgeServiceEntityEqAnyAdditionalInfoAny(new Device(), new Device(),
|
||||||
|
|||||||
@ -387,7 +387,7 @@ public abstract class BaseDeviceProfileControllerTest extends AbstractController
|
|||||||
testNotifyManyEntityManyTimeMsgToEdgeServiceEntityEqAny(new DeviceProfile(), new DeviceProfile(),
|
testNotifyManyEntityManyTimeMsgToEdgeServiceEntityEqAny(new DeviceProfile(), new DeviceProfile(),
|
||||||
savedTenant.getId(), tenantAdmin.getCustomerId(), tenantAdmin.getId(), tenantAdmin.getEmail(),
|
savedTenant.getId(), tenantAdmin.getCustomerId(), tenantAdmin.getId(), tenantAdmin.getEmail(),
|
||||||
ActionType.ADDED, ActionType.ADDED, cntEntity, cntEntity, cntEntity);
|
ActionType.ADDED, ActionType.ADDED, cntEntity, cntEntity, cntEntity);
|
||||||
Mockito.reset(tbClusterService, auditLogService, gatewayNotificationsService);
|
Mockito.reset(tbClusterService, auditLogService);
|
||||||
|
|
||||||
List<DeviceProfile> loadedDeviceProfiles = new ArrayList<>();
|
List<DeviceProfile> loadedDeviceProfiles = new ArrayList<>();
|
||||||
pageLink = new PageLink(17);
|
pageLink = new PageLink(17);
|
||||||
|
|||||||
@ -149,7 +149,7 @@ public abstract class BaseEntityViewControllerTest extends AbstractControllerTes
|
|||||||
testNotifyManyEntityManyTimeMsgToEdgeServiceEntityEqAny(foundEntityView, foundEntityView,
|
testNotifyManyEntityManyTimeMsgToEdgeServiceEntityEqAny(foundEntityView, foundEntityView,
|
||||||
tenantId, tenantAdminCustomerId, tenantAdminUserId, TENANT_ADMIN_EMAIL,
|
tenantId, tenantAdminCustomerId, tenantAdminUserId, TENANT_ADMIN_EMAIL,
|
||||||
ActionType.ADDED, ActionType.ADDED, 1, 0, 1);
|
ActionType.ADDED, ActionType.ADDED, 1, 0, 1);
|
||||||
Mockito.reset(tbClusterService, auditLogService, gatewayNotificationsService);
|
Mockito.reset(tbClusterService, auditLogService);
|
||||||
|
|
||||||
savedView.setName("New test entity view");
|
savedView.setName("New test entity view");
|
||||||
|
|
||||||
@ -265,7 +265,7 @@ public abstract class BaseEntityViewControllerTest extends AbstractControllerTes
|
|||||||
testNotifyManyEntityManyTimeMsgToEdgeServiceEntityEqAny(savedView, savedView,
|
testNotifyManyEntityManyTimeMsgToEdgeServiceEntityEqAny(savedView, savedView,
|
||||||
tenantId, tenantAdminCustomerId, tenantAdminUserId, TENANT_ADMIN_EMAIL,
|
tenantId, tenantAdminCustomerId, tenantAdminUserId, TENANT_ADMIN_EMAIL,
|
||||||
ActionType.UPDATED, ActionType.UPDATED, 1, 1, 5);
|
ActionType.UPDATED, ActionType.UPDATED, 1, 1, 5);
|
||||||
Mockito.reset(tbClusterService, auditLogService, gatewayNotificationsService);
|
Mockito.reset(tbClusterService, auditLogService);
|
||||||
|
|
||||||
EntityView assignedView = doPost(
|
EntityView assignedView = doPost(
|
||||||
"/api/customer/" + savedCustomer.getId().getId().toString() + "/entityView/" + savedView.getId().getId().toString(),
|
"/api/customer/" + savedCustomer.getId().getId().toString() + "/entityView/" + savedView.getId().getId().toString(),
|
||||||
|
|||||||
@ -185,6 +185,7 @@ public abstract class BaseRuleChainControllerTest extends AbstractControllerTest
|
|||||||
savedTenant.getId(), tenantAdmin.getCustomerId(), tenantAdmin.getId(), tenantAdmin.getEmail(),
|
savedTenant.getId(), tenantAdmin.getCustomerId(), tenantAdmin.getId(), tenantAdmin.getEmail(),
|
||||||
ActionType.ASSIGNED_TO_EDGE, ActionType.ASSIGNED_TO_EDGE, cntEntity, cntEntity, cntEntity * 2,
|
ActionType.ASSIGNED_TO_EDGE, ActionType.ASSIGNED_TO_EDGE, cntEntity, cntEntity, cntEntity * 2,
|
||||||
new String(), new String(), new String());
|
new String(), new String(), new String());
|
||||||
|
Mockito.reset(tbClusterService, auditLogService);
|
||||||
|
|
||||||
List<RuleChain> loadedEdgeRuleChains = new ArrayList<>();
|
List<RuleChain> loadedEdgeRuleChains = new ArrayList<>();
|
||||||
pageLink = new PageLink(17);
|
pageLink = new PageLink(17);
|
||||||
@ -203,8 +204,6 @@ public abstract class BaseRuleChainControllerTest extends AbstractControllerTest
|
|||||||
|
|
||||||
Assert.assertEquals(edgeRuleChains, loadedEdgeRuleChains);
|
Assert.assertEquals(edgeRuleChains, loadedEdgeRuleChains);
|
||||||
|
|
||||||
Mockito.reset(tbClusterService, auditLogService);
|
|
||||||
|
|
||||||
for (RuleChain ruleChain : loadedEdgeRuleChains) {
|
for (RuleChain ruleChain : loadedEdgeRuleChains) {
|
||||||
if (!ruleChain.isRoot()) {
|
if (!ruleChain.isRoot()) {
|
||||||
doDelete("/api/edge/" + savedEdge.getId().getId().toString()
|
doDelete("/api/edge/" + savedEdge.getId().getId().toString()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user