|
|
@ -38,14 +38,4 @@ public class AlarmControlHandlerTest {
|
|
|
|
alarmControlHandler.initCacheAndLock("1", "Wechat", 1);
|
|
|
|
alarmControlHandler.initCacheAndLock("1", "Wechat", 1);
|
|
|
|
Assert.assertTrue(alarmControlHandler.isSendAlarm(alarmControlDTO));
|
|
|
|
Assert.assertTrue(alarmControlHandler.isSendAlarm(alarmControlDTO));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
|
|
|
public void assertExpireAfterSendAlarm() throws InterruptedException {
|
|
|
|
|
|
|
|
AlarmControlHandler alarmControlHandler = new AlarmControlHandler();
|
|
|
|
|
|
|
|
AlarmControlDTO alarmControlDTO = new AlarmControlDTO("1", "Wechat", NotifyTypeEnum.ACTIVITY);
|
|
|
|
|
|
|
|
alarmControlHandler.initCacheAndLock("1", "Wechat", 1);
|
|
|
|
|
|
|
|
alarmControlHandler.isSendAlarm(alarmControlDTO);
|
|
|
|
|
|
|
|
Thread.sleep(60 * 1000);
|
|
|
|
|
|
|
|
Assert.assertTrue(alarmControlHandler.isSendAlarm(alarmControlDTO));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|