From d9fb40b9d12b5d76b3ab5debb7f22dc4dbc7aaec Mon Sep 17 00:00:00 2001 From: mabofu Date: Mon, 20 Jan 2025 18:34:21 +0800 Subject: [PATCH] Fixed code coverage: fixed AlertRuleTypeEnum junit test --- .../common/constat/AlertRuleTypeEnumTest.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 dsms-engine-application/src/test/java/com/dsms/common/constat/AlertRuleTypeEnumTest.java diff --git a/dsms-engine-application/src/test/java/com/dsms/common/constat/AlertRuleTypeEnumTest.java b/dsms-engine-application/src/test/java/com/dsms/common/constat/AlertRuleTypeEnumTest.java new file mode 100644 index 0000000..b74165b --- /dev/null +++ b/dsms-engine-application/src/test/java/com/dsms/common/constat/AlertRuleTypeEnumTest.java @@ -0,0 +1,19 @@ +package com.dsms.common.constat; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import com.dsms.common.constant.AlertRuleTypeEnum; +import org.junit.jupiter.api.Test; + +class AlertRuleTypeEnumTest { + + @Test + void testGetByCode() { + assertEquals(AlertRuleTypeEnum.CPU_USAGE, AlertRuleTypeEnum.getalertRuleTypeEnum("cpu.usage")); + } + + @Test + void testGetWrongCode() { + assertEquals(AlertRuleTypeEnum.UNKNOW, AlertRuleTypeEnum.getalertRuleTypeEnum("test")); + } +} -- Gitee