Skip to content

Commit 026fb45

Browse files
authored
Merge pull request #555 from yanhom1314/master
fix test case
2 parents fd2cedb + 7ba7016 commit 026fb45

File tree

2 files changed

+5
-103
lines changed

2 files changed

+5
-103
lines changed

core/src/main/java/org/dromara/dynamictp/core/notifier/alarm/AlarmCounter.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import org.dromara.dynamictp.common.em.NotifyItemEnum;
2424
import org.dromara.dynamictp.common.entity.AlarmInfo;
2525
import org.dromara.dynamictp.common.entity.NotifyItem;
26+
import org.dromara.dynamictp.common.ex.DtpException;
2627
import org.dromara.dynamictp.common.util.DateUtil;
2728

2829
import java.util.Map;
@@ -58,11 +59,11 @@ public static void initAlarmCounter(String threadPoolName, NotifyItem notifyItem
5859

5960
public static AlarmInfo getAlarmInfo(String threadPoolName, String notifyType) {
6061
String key = buildKey(threadPoolName, notifyType);
61-
val alarmInfo = ALARM_INFO_CACHE.get(key);
62-
if (Objects.isNull(alarmInfo)) {
63-
return null;
62+
val cache = ALARM_INFO_CACHE.get(key);
63+
if (Objects.isNull(cache)) {
64+
throw new DtpException("Alarm info cache has not been initialized for " + key);
6465
}
65-
return alarmInfo.getIfPresent(notifyType);
66+
return cache.getIfPresent(notifyType);
6667
}
6768

6869
public static int getCount(String threadPoolName, String notifyType) {

test/test-core/src/test/java/org/dromara/dynamictp/test/core/support/DtpLifecycleSupportTest.java

-99
This file was deleted.

0 commit comments

Comments
 (0)