refactoring: tests Device, Dashboard add int cntTimeEdge, int cntTimeRuleEngine
This commit is contained in:
parent
3ca714d3d4
commit
cb8f11e210
@ -116,7 +116,7 @@ public class DefaultTbDeviceService extends AbstractTbEntityService implements T
|
||||
try {
|
||||
Device savedDevice = checkNotNull(deviceService.assignDeviceToCustomer(tenantId, deviceId, customerId));
|
||||
notificationEntityService.notifyAssignOrUnassignEntityToCustomer(tenantId, deviceId, customerId, savedDevice,
|
||||
actionType, edgeTypeByActionType(actionType), user, true, deviceId.toString(), customerId.toString(), customer.getName());
|
||||
actionType, user, true, deviceId.toString(), customerId.toString(), customer.getName());
|
||||
|
||||
return savedDevice;
|
||||
} catch (Exception e) {
|
||||
|
||||
@ -111,14 +111,15 @@ public abstract class AbstractNotifyEntityTest extends AbstractWebTest {
|
||||
|
||||
protected void testNotifyManyEntityManyTimeMsgToEdgeServiceEntityEqAny(HasName entity, HasName originator,
|
||||
TenantId tenantId, CustomerId customerId, UserId userId, String userName,
|
||||
ActionType actionType, ActionType actionTypeEdge, int cntTime, int cntTimeEdge, Object... additionalInfo) {
|
||||
ActionType actionType, ActionType actionTypeEdge,
|
||||
int cntTime, int cntTimeEdge, int cntTimeRuleEngine, Object... additionalInfo) {
|
||||
EntityId originatorId = createEntityId_NULL_UUID(originator);
|
||||
testSendNotificationMsgToEdgeServiceTimeEntityEqAny(tenantId, actionTypeEdge, cntTime);
|
||||
testSendNotificationMsgToEdgeServiceTimeEntityEqAny(tenantId, actionTypeEdge, cntTimeEdge);
|
||||
ArgumentMatcher<HasName> matcherEntityClassEquals = argument -> argument.getClass().equals(entity.getClass());
|
||||
ArgumentMatcher<EntityId> matcherOriginatorId = argument -> argument.getClass().equals(originatorId.getClass());
|
||||
testLogEntityActionAdditionalInfo(matcherEntityClassEquals, matcherOriginatorId, tenantId, customerId, userId, userName, actionType, cntTime,
|
||||
extractMatcherAdditionalInfo(additionalInfo));
|
||||
testPushMsgToRuleEngineTime(originatorId, tenantId, cntTimeEdge);
|
||||
testPushMsgToRuleEngineTime(originatorId, tenantId, cntTimeRuleEngine);
|
||||
Mockito.reset(tbClusterService, auditLogService);
|
||||
}
|
||||
|
||||
@ -126,7 +127,7 @@ public abstract class AbstractNotifyEntityTest extends AbstractWebTest {
|
||||
TenantId tenantId, CustomerId customerId, UserId userId, String userName,
|
||||
ActionType actionType, ActionType actionTypeEdge, int cntTime, int cntTimeEdge, int cntAdditionalInfo) {
|
||||
EntityId originatorId = createEntityId_NULL_UUID(originator);
|
||||
testSendNotificationMsgToEdgeServiceTimeEntityEqAny(tenantId, actionTypeEdge, cntTime);
|
||||
testSendNotificationMsgToEdgeServiceTimeEntityEqAny(tenantId, actionTypeEdge, cntTimeEdge);
|
||||
ArgumentMatcher<HasName> matcherEntityClassEquals = argument -> argument.getClass().equals(entity.getClass());
|
||||
ArgumentMatcher<EntityId> matcherOriginatorId = argument -> argument.getClass().equals(originatorId.getClass());
|
||||
testLogEntityActionAdditionalInfoAny(matcherEntityClassEquals, matcherOriginatorId, tenantId, customerId, userId, userName, actionType, cntTime,
|
||||
|
||||
@ -432,7 +432,7 @@ public abstract class BaseDashboardControllerTest extends AbstractControllerTest
|
||||
|
||||
testNotifyManyEntityManyTimeMsgToEdgeServiceEntityEqAny(new Dashboard(), new Dashboard(),
|
||||
savedTenant.getId(), tenantAdmin.getCustomerId(), tenantAdmin.getId(), tenantAdmin.getEmail(),
|
||||
ActionType.ADDED, ActionType.ASSIGNED_TO_CUSTOMER, cntEntity, cntEntity*2);
|
||||
ActionType.ADDED, ActionType.ASSIGNED_TO_CUSTOMER, cntEntity, cntEntity, cntEntity*2);
|
||||
|
||||
List<DashboardInfo> loadedDashboards = new ArrayList<>();
|
||||
PageLink pageLink = new PageLink(21);
|
||||
|
||||
@ -798,7 +798,7 @@ public abstract class BaseDeviceControllerTest extends AbstractControllerTest {
|
||||
|
||||
testNotifyManyEntityManyTimeMsgToEdgeServiceEntityEqAny(new Device(), new Device(),
|
||||
savedTenant.getId(), tenantAdmin.getCustomerId(), tenantAdmin.getId(), tenantAdmin.getEmail(),
|
||||
ActionType.ADDED, ActionType.ASSIGNED_TO_CUSTOMER, cntEntity, cntEntity * 2);
|
||||
ActionType.ADDED, ActionType.ASSIGNED_TO_CUSTOMER, cntEntity, cntEntity, cntEntity * 2);
|
||||
testNotificationUpdateGatewayNever();
|
||||
|
||||
List<Device> loadedDevices = new ArrayList<>(cntEntity);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user