@ -29,7 +29,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean ;
import org.springframework.context.annotation.Primary ;
import org.springframework.test.context.ContextConfiguration ;
import org.springframework.test.web.servlet.ResultActions ;
import org.thingsboard.common.util.JacksonUtil ;
import org.thingsboard.server.common.data.Device ;
import org.thingsboard.server.common.data.EntityType ;
@ -180,7 +179,7 @@ public abstract class BaseAlarmControllerTest extends AbstractControllerTest {
foundAlarm = doGet ( "/api/alarm/info/" + updatedAlarm . getId ( ) , AlarmInfo . class ) ;
testNotifyEntityAllOneTime ( foundAlarm , foundAlarm . getId ( ) , foundAlarm . getOriginator ( ) ,
tenantId , customerId , tenantAdminUserId , TENANT_ADMIN_EMAIL , ActionType . ALARM_ASSIGN ) ;
tenantId , customerId , tenantAdminUserId , TENANT_ADMIN_EMAIL , ActionType . ALARM_ASSIGNED ) ;
alarm = updatedAlarm ;
alarm . setAssigneeId ( null ) ;
@ -192,7 +191,7 @@ public abstract class BaseAlarmControllerTest extends AbstractControllerTest {
foundAlarm = doGet ( "/api/alarm/info/" + updatedAlarm . getId ( ) , AlarmInfo . class ) ;
testNotifyEntityAllOneTime ( foundAlarm , foundAlarm . getId ( ) , foundAlarm . getOriginator ( ) ,
tenantId , customerId , tenantAdminUserId , TENANT_ADMIN_EMAIL , ActionType . ALARM_UNASSIGN ) ;
tenantId , customerId , tenantAdminUserId , TENANT_ADMIN_EMAIL , ActionType . ALARM_UNASSIGNED ) ;
}
@Test
@ -414,7 +413,7 @@ public abstract class BaseAlarmControllerTest extends AbstractControllerTest {
Assert . assertTrue ( foundAlarm . getAssignTs ( ) > beforeAssignmentTs & & foundAlarm . getAssignTs ( ) < System . currentTimeMillis ( ) ) ;
testNotifyEntityAllOneTime ( foundAlarm , foundAlarm . getId ( ) , foundAlarm . getOriginator ( ) ,
tenantId , customerId , tenantAdminUserId , TENANT_ADMIN_EMAIL , ActionType . ALARM_ASSIGN ) ;
tenantId , customerId , tenantAdminUserId , TENANT_ADMIN_EMAIL , ActionType . ALARM_ASSIGNED ) ;
}
@Test
@ -445,7 +444,7 @@ public abstract class BaseAlarmControllerTest extends AbstractControllerTest {
Assert . assertTrue ( foundAlarm . getAssignTs ( ) > beforeAssignmentTs & & foundAlarm . getAssignTs ( ) < System . currentTimeMillis ( ) ) ;
testNotifyEntityAllOneTime ( foundAlarm , foundAlarm . getId ( ) , foundAlarm . getOriginator ( ) ,
tenantId , customerId , tenantAdminUserId , TENANT_ADMIN_EMAIL , ActionType . ALARM_ASSIGN ) ;
tenantId , customerId , tenantAdminUserId , TENANT_ADMIN_EMAIL , ActionType . ALARM_ASSIGNED ) ;
logout ( ) ;
@ -462,7 +461,7 @@ public abstract class BaseAlarmControllerTest extends AbstractControllerTest {
Assert . assertTrue ( foundAlarm . getAssignTs ( ) > beforeAssignmentTs & & foundAlarm . getAssignTs ( ) < System . currentTimeMillis ( ) ) ;
testNotifyEntityAllOneTime ( foundAlarm , foundAlarm . getId ( ) , foundAlarm . getOriginator ( ) ,
tenantId , customerId , customerUserId , CUSTOMER_USER_EMAIL , ActionType . ALARM_ASSIGN ) ;
tenantId , customerId , customerUserId , CUSTOMER_USER_EMAIL , ActionType . ALARM_ASSIGNED ) ;
}
@Test
@ -480,7 +479,7 @@ public abstract class BaseAlarmControllerTest extends AbstractControllerTest {
Assert . assertTrue ( foundAlarm . getAssignTs ( ) > beforeAssignmentTs & & foundAlarm . getAssignTs ( ) < System . currentTimeMillis ( ) ) ;
testNotifyEntityAllOneTime ( foundAlarm , foundAlarm . getId ( ) , foundAlarm . getOriginator ( ) ,
tenantId , customerId , tenantAdminUserId , TENANT_ADMIN_EMAIL , ActionType . ALARM_ASSIGN ) ;
tenantId , customerId , tenantAdminUserId , TENANT_ADMIN_EMAIL , ActionType . ALARM_ASSIGNED ) ;
beforeAssignmentTs = System . currentTimeMillis ( ) ;
Thread . sleep ( 2 ) ;
@ -491,7 +490,7 @@ public abstract class BaseAlarmControllerTest extends AbstractControllerTest {
Assert . assertTrue ( foundAlarm . getAssignTs ( ) > beforeAssignmentTs & & foundAlarm . getAssignTs ( ) < System . currentTimeMillis ( ) ) ;
testNotifyEntityAllOneTime ( foundAlarm , foundAlarm . getId ( ) , foundAlarm . getOriginator ( ) ,
tenantId , customerId , tenantAdminUserId , TENANT_ADMIN_EMAIL , ActionType . ALARM_UNASSIGN ) ;
tenantId , customerId , tenantAdminUserId , TENANT_ADMIN_EMAIL , ActionType . ALARM_UNASSIGNED ) ;
}
@Test
@ -509,7 +508,7 @@ public abstract class BaseAlarmControllerTest extends AbstractControllerTest {
Assert . assertTrue ( foundAlarm . getAssignTs ( ) > beforeAssignmentTs & & foundAlarm . getAssignTs ( ) < System . currentTimeMillis ( ) ) ;
testNotifyEntityAllOneTime ( foundAlarm , foundAlarm . getId ( ) , foundAlarm . getOriginator ( ) ,
tenantId , customerId , tenantAdminUserId , TENANT_ADMIN_EMAIL , ActionType . ALARM_ASSIGN ) ;
tenantId , customerId , tenantAdminUserId , TENANT_ADMIN_EMAIL , ActionType . ALARM_ASSIGNED ) ;
logout ( ) ;
loginCustomerUser ( ) ;
@ -525,7 +524,7 @@ public abstract class BaseAlarmControllerTest extends AbstractControllerTest {
Assert . assertTrue ( foundAlarm . getAssignTs ( ) > beforeAssignmentTs & & foundAlarm . getAssignTs ( ) < System . currentTimeMillis ( ) ) ;
testNotifyEntityAllOneTime ( foundAlarm , foundAlarm . getId ( ) , foundAlarm . getOriginator ( ) ,
tenantId , customerId , customerUserId , CUSTOMER_USER_EMAIL , ActionType . ALARM_UNASSIGN ) ;
tenantId , customerId , customerUserId , CUSTOMER_USER_EMAIL , ActionType . ALARM_UNASSIGNED ) ;
}
@Test