diff --git a/server/home/home-web/src/test/java/io/holoinsight/server/home/web/controller/AlarmRuleFacadeImplTest.java b/server/home/home-web/src/test/java/io/holoinsight/server/home/web/controller/AlarmRuleFacadeImplTest.java index 1806753a5..97125242b 100644 --- a/server/home/home-web/src/test/java/io/holoinsight/server/home/web/controller/AlarmRuleFacadeImplTest.java +++ b/server/home/home-web/src/test/java/io/holoinsight/server/home/web/controller/AlarmRuleFacadeImplTest.java @@ -7,6 +7,7 @@ import io.holoinsight.server.home.biz.service.AlertGroupService; import io.holoinsight.server.home.biz.service.AlertRuleService; import io.holoinsight.server.home.biz.service.AlertSubscribeService; +import io.holoinsight.server.home.common.service.RequestContextAdapterImpl; import io.holoinsight.server.home.common.util.scope.MonitorScope; import io.holoinsight.server.home.common.util.scope.MonitorUser; import io.holoinsight.server.home.common.util.scope.RequestContext; @@ -44,6 +45,7 @@ public void setUp() throws Exception { facade.alarmSubscribeService = Mockito.mock(AlertSubscribeService.class); facade.alarmRuleService = Mockito.mock(AlertRuleService.class); facade.alarmRuleConverter = new AlarmRuleConverterImpl(); + facade.requestContextAdapter = new RequestContextAdapterImpl(); MonitorUser mu = new MonitorUser(); mu.setLoginName("test_loginName"); mu.setUserId("test_userId"); @@ -78,7 +80,8 @@ public void setUp() throws Exception { @Test public void testGetRuleListByGroup() { - List alarmRuleDTOList = facade.getRuleListByGroup(true, tenant, workspace); + List alarmRuleDTOList = + facade.getRuleListByGroup(true, "test_tenant", "workspace"); Mockito.verify(facade.alarmRuleService).list(argument.capture()); QueryWrapper queryWrapper = argument.getValue(); @@ -94,7 +97,7 @@ public void testGetRuleListByGroup() { @Test public void testGetRuleListByGroup_false() { - facade.getRuleListByGroup(false, tenant, workspace); + facade.getRuleListByGroup(false, "test_tenant", "workspace"); Mockito.verify(facade.alarmRuleService).list(argument.capture()); QueryWrapper queryWrapper = argument.getValue(); Assert.assertEquals("(id IN (#{ew.paramNameValuePairs.MPGENVAL1}))", @@ -103,7 +106,8 @@ public void testGetRuleListByGroup_false() { @Test public void testGetRuleListBySubscribe() { - List alarmRuleDTOList = facade.getRuleListBySubscribe(true, tenant, workspace); + List alarmRuleDTOList = + facade.getRuleListBySubscribe(true, "test_tenant", "workspace"); Mockito.verify(facade.alarmRuleService).list(argument.capture()); QueryWrapper queryWrapper = argument.getValue(); Assert.assertEquals( @@ -118,7 +122,8 @@ public void testGetRuleListBySubscribe() { @Test public void testGetRuleListBySubscribe_false() { - List alarmRuleDTOList = facade.getRuleListBySubscribe(false, tenant, workspace); + List alarmRuleDTOList = + facade.getRuleListBySubscribe(false, "test_tenant", "workspace"); Mockito.verify(facade.alarmRuleService).list(argument.capture()); QueryWrapper queryWrapper = argument.getValue(); Assert.assertEquals("(id IN (#{ew.paramNameValuePairs.MPGENVAL1}))",