|
|
|
@ -169,7 +169,7 @@ public class AlarmControllerTest extends AbstractControllerTest { |
|
|
|
foundAlarm = doGet("/api/alarm/info/" + updatedAlarm.getId(), AlarmInfo.class); |
|
|
|
|
|
|
|
testNotifyManyEntityManyTimeMsgToEdgeServiceEntityEqAny(foundAlarm, customerDevice, tenantId, |
|
|
|
customerId, tenantAdminUserId, TENANT_ADMIN_EMAIL, ActionType.ALARM_ACK, 1, 1, 1); |
|
|
|
customerId, tenantAdminUserId, TENANT_ADMIN_EMAIL, ActionType.ALARM_ACK, 1, 0, 1); |
|
|
|
Mockito.reset(tbClusterService, auditLogService); |
|
|
|
|
|
|
|
alarm = updatedAlarm; |
|
|
|
@ -183,7 +183,7 @@ public class AlarmControllerTest extends AbstractControllerTest { |
|
|
|
foundAlarm = doGet("/api/alarm/info/" + updatedAlarm.getId(), AlarmInfo.class); |
|
|
|
|
|
|
|
testNotifyManyEntityManyTimeMsgToEdgeServiceEntityEqAny(foundAlarm, customerDevice, tenantId, |
|
|
|
customerId, tenantAdminUserId, TENANT_ADMIN_EMAIL, ActionType.ALARM_CLEAR, 1, 1, 1); |
|
|
|
customerId, tenantAdminUserId, TENANT_ADMIN_EMAIL, ActionType.ALARM_CLEAR, 1, 0, 1); |
|
|
|
Mockito.reset(tbClusterService, auditLogService); |
|
|
|
|
|
|
|
alarm = updatedAlarm; |
|
|
|
@ -197,7 +197,7 @@ public class AlarmControllerTest extends AbstractControllerTest { |
|
|
|
foundAlarm = doGet("/api/alarm/info/" + updatedAlarm.getId(), AlarmInfo.class); |
|
|
|
|
|
|
|
testNotifyManyEntityManyTimeMsgToEdgeServiceEntityEqAny(foundAlarm, customerDevice, tenantId, |
|
|
|
customerId, tenantAdminUserId, TENANT_ADMIN_EMAIL, ActionType.ALARM_ASSIGNED, 1, 1, 1); |
|
|
|
customerId, tenantAdminUserId, TENANT_ADMIN_EMAIL, ActionType.ALARM_ASSIGNED, 1, 0, 1); |
|
|
|
Mockito.reset(tbClusterService, auditLogService); |
|
|
|
|
|
|
|
alarm = updatedAlarm; |
|
|
|
@ -211,7 +211,7 @@ public class AlarmControllerTest extends AbstractControllerTest { |
|
|
|
foundAlarm = doGet("/api/alarm/info/" + updatedAlarm.getId(), AlarmInfo.class); |
|
|
|
|
|
|
|
testNotifyManyEntityManyTimeMsgToEdgeServiceEntityEqAny(foundAlarm, customerDevice, tenantId, |
|
|
|
customerId, tenantAdminUserId, TENANT_ADMIN_EMAIL, ActionType.ALARM_UNASSIGNED, 1, 1, 1); |
|
|
|
customerId, tenantAdminUserId, TENANT_ADMIN_EMAIL, ActionType.ALARM_UNASSIGNED, 1, 0, 1); |
|
|
|
Mockito.reset(tbClusterService, auditLogService); |
|
|
|
|
|
|
|
} |
|
|
|
@ -321,7 +321,7 @@ public class AlarmControllerTest extends AbstractControllerTest { |
|
|
|
Assert.assertNotNull(foundAlarm); |
|
|
|
Assert.assertEquals(AlarmStatus.CLEARED_UNACK, foundAlarm.getStatus()); |
|
|
|
|
|
|
|
testNotifyEntityAllOneTime(foundAlarm, foundAlarm.getId(), foundAlarm.getOriginator(), |
|
|
|
testNotifyEntityOneTimeMsgToEdgeServiceNever(foundAlarm, foundAlarm.getId(), foundAlarm.getOriginator(), |
|
|
|
tenantId, customerId, customerUserId, CUSTOMER_USER_EMAIL, ActionType.ALARM_CLEAR); |
|
|
|
} |
|
|
|
|
|
|
|
@ -337,7 +337,7 @@ public class AlarmControllerTest extends AbstractControllerTest { |
|
|
|
Assert.assertNotNull(foundAlarm); |
|
|
|
Assert.assertEquals(AlarmStatus.CLEARED_UNACK, foundAlarm.getStatus()); |
|
|
|
|
|
|
|
testNotifyEntityAllOneTime(foundAlarm, foundAlarm.getId(), foundAlarm.getOriginator(), |
|
|
|
testNotifyEntityOneTimeMsgToEdgeServiceNever(foundAlarm, foundAlarm.getId(), foundAlarm.getOriginator(), |
|
|
|
tenantId, customerId, tenantAdminUserId, TENANT_ADMIN_EMAIL, ActionType.ALARM_CLEAR); |
|
|
|
} |
|
|
|
|
|
|
|
@ -354,7 +354,7 @@ public class AlarmControllerTest extends AbstractControllerTest { |
|
|
|
Assert.assertNotNull(foundAlarm); |
|
|
|
Assert.assertEquals(AlarmStatus.ACTIVE_ACK, foundAlarm.getStatus()); |
|
|
|
|
|
|
|
testNotifyEntityAllOneTime(foundAlarm, foundAlarm.getId(), foundAlarm.getOriginator(), |
|
|
|
testNotifyEntityOneTimeMsgToEdgeServiceNever(foundAlarm, foundAlarm.getId(), foundAlarm.getOriginator(), |
|
|
|
tenantId, customerId, customerUserId, CUSTOMER_USER_EMAIL, ActionType.ALARM_ACK); |
|
|
|
} |
|
|
|
|
|
|
|
@ -434,7 +434,7 @@ public class AlarmControllerTest extends AbstractControllerTest { |
|
|
|
Assert.assertEquals(tenantAdminUserId, foundAlarm.getAssigneeId()); |
|
|
|
Assert.assertTrue(foundAlarm.getAssignTs() > beforeAssignmentTs && foundAlarm.getAssignTs() < System.currentTimeMillis()); |
|
|
|
|
|
|
|
testNotifyEntityAllOneTime(foundAlarm, foundAlarm.getId(), foundAlarm.getOriginator(), |
|
|
|
testNotifyEntityOneTimeMsgToEdgeServiceNever(foundAlarm, foundAlarm.getId(), foundAlarm.getOriginator(), |
|
|
|
tenantId, customerId, tenantAdminUserId, TENANT_ADMIN_EMAIL, ActionType.ALARM_ASSIGNED); |
|
|
|
} |
|
|
|
|
|
|
|
@ -465,7 +465,7 @@ public class AlarmControllerTest extends AbstractControllerTest { |
|
|
|
Assert.assertEquals(tenantAdminUserId, foundAlarm.getAssigneeId()); |
|
|
|
Assert.assertTrue(foundAlarm.getAssignTs() > beforeAssignmentTs && foundAlarm.getAssignTs() < System.currentTimeMillis()); |
|
|
|
|
|
|
|
testNotifyEntityAllOneTime(foundAlarm, foundAlarm.getId(), foundAlarm.getOriginator(), |
|
|
|
testNotifyEntityOneTimeMsgToEdgeServiceNever(foundAlarm, foundAlarm.getId(), foundAlarm.getOriginator(), |
|
|
|
tenantId, customerId, tenantAdminUserId, TENANT_ADMIN_EMAIL, ActionType.ALARM_ASSIGNED); |
|
|
|
|
|
|
|
logout(); |
|
|
|
@ -482,7 +482,7 @@ public class AlarmControllerTest extends AbstractControllerTest { |
|
|
|
Assert.assertEquals(customerUserId, foundAlarm.getAssigneeId()); |
|
|
|
Assert.assertTrue(foundAlarm.getAssignTs() > beforeAssignmentTs && foundAlarm.getAssignTs() < System.currentTimeMillis()); |
|
|
|
|
|
|
|
testNotifyEntityAllOneTime(foundAlarm, foundAlarm.getId(), foundAlarm.getOriginator(), |
|
|
|
testNotifyEntityOneTimeMsgToEdgeServiceNever(foundAlarm, foundAlarm.getId(), foundAlarm.getOriginator(), |
|
|
|
tenantId, customerId, customerUserId, CUSTOMER_USER_EMAIL, ActionType.ALARM_ASSIGNED); |
|
|
|
} |
|
|
|
|
|
|
|
@ -500,7 +500,7 @@ public class AlarmControllerTest extends AbstractControllerTest { |
|
|
|
Assert.assertEquals(tenantAdminUserId, foundAlarm.getAssigneeId()); |
|
|
|
Assert.assertTrue(foundAlarm.getAssignTs() > beforeAssignmentTs && foundAlarm.getAssignTs() < System.currentTimeMillis()); |
|
|
|
|
|
|
|
testNotifyEntityAllOneTime(foundAlarm, foundAlarm.getId(), foundAlarm.getOriginator(), |
|
|
|
testNotifyEntityOneTimeMsgToEdgeServiceNever(foundAlarm, foundAlarm.getId(), foundAlarm.getOriginator(), |
|
|
|
tenantId, customerId, tenantAdminUserId, TENANT_ADMIN_EMAIL, ActionType.ALARM_ASSIGNED); |
|
|
|
|
|
|
|
beforeAssignmentTs = System.currentTimeMillis(); |
|
|
|
@ -511,7 +511,7 @@ public class AlarmControllerTest extends AbstractControllerTest { |
|
|
|
Assert.assertNull(foundAlarm.getAssigneeId()); |
|
|
|
Assert.assertTrue(foundAlarm.getAssignTs() > beforeAssignmentTs && foundAlarm.getAssignTs() < System.currentTimeMillis()); |
|
|
|
|
|
|
|
testNotifyEntityAllOneTime(foundAlarm, foundAlarm.getId(), foundAlarm.getOriginator(), |
|
|
|
testNotifyEntityOneTimeMsgToEdgeServiceNever(foundAlarm, foundAlarm.getId(), foundAlarm.getOriginator(), |
|
|
|
tenantId, customerId, tenantAdminUserId, TENANT_ADMIN_EMAIL, ActionType.ALARM_UNASSIGNED); |
|
|
|
} |
|
|
|
|
|
|
|
@ -529,7 +529,7 @@ public class AlarmControllerTest extends AbstractControllerTest { |
|
|
|
Assert.assertEquals(tenantAdminUserId, foundAlarm.getAssigneeId()); |
|
|
|
Assert.assertTrue(foundAlarm.getAssignTs() > beforeAssignmentTs && foundAlarm.getAssignTs() < System.currentTimeMillis()); |
|
|
|
|
|
|
|
testNotifyEntityAllOneTime(foundAlarm, foundAlarm.getId(), foundAlarm.getOriginator(), |
|
|
|
testNotifyEntityOneTimeMsgToEdgeServiceNever(foundAlarm, foundAlarm.getId(), foundAlarm.getOriginator(), |
|
|
|
tenantId, customerId, tenantAdminUserId, TENANT_ADMIN_EMAIL, ActionType.ALARM_ASSIGNED); |
|
|
|
|
|
|
|
logout(); |
|
|
|
@ -545,7 +545,7 @@ public class AlarmControllerTest extends AbstractControllerTest { |
|
|
|
Assert.assertNull(foundAlarm.getAssigneeId()); |
|
|
|
Assert.assertTrue(foundAlarm.getAssignTs() > beforeAssignmentTs && foundAlarm.getAssignTs() < System.currentTimeMillis()); |
|
|
|
|
|
|
|
testNotifyEntityAllOneTime(foundAlarm, foundAlarm.getId(), foundAlarm.getOriginator(), |
|
|
|
testNotifyEntityOneTimeMsgToEdgeServiceNever(foundAlarm, foundAlarm.getId(), foundAlarm.getOriginator(), |
|
|
|
tenantId, customerId, customerUserId, CUSTOMER_USER_EMAIL, ActionType.ALARM_UNASSIGNED); |
|
|
|
} |
|
|
|
|
|
|
|
|