From 2b4967270e624300f2890d604a6d1f013c084f10 Mon Sep 17 00:00:00 2001 From: FengLiang Date: Fri, 24 Feb 2017 15:27:04 +0800 Subject: Remove DBException Change-Id: I1eaadc6f893e98d0fe79769e21bcfea5f076b90c Issue-ID: HOLMES-47 Signed-off-by: FengLiang --- .../openo/holmes/engine/wrapper/RuleMgtWrapperTest.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'engine-d/src/test/java') diff --git a/engine-d/src/test/java/org/openo/holmes/engine/wrapper/RuleMgtWrapperTest.java b/engine-d/src/test/java/org/openo/holmes/engine/wrapper/RuleMgtWrapperTest.java index 75c4a20..593b1ce 100644 --- a/engine-d/src/test/java/org/openo/holmes/engine/wrapper/RuleMgtWrapperTest.java +++ b/engine-d/src/test/java/org/openo/holmes/engine/wrapper/RuleMgtWrapperTest.java @@ -16,21 +16,22 @@ package org.openo.holmes.engine.wrapper; +import static org.easymock.EasyMock.anyInt; +import static org.easymock.EasyMock.anyObject; +import static org.easymock.EasyMock.expect; + +import java.util.ArrayList; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import org.openo.holmes.common.api.entity.CorrelationRule; -import org.openo.holmes.common.exception.DbException; +import org.openo.holmes.common.exception.CorrelationException; import org.openo.holmes.common.utils.DbDaoUtil; import org.openo.holmes.engine.db.CorrelationRuleDao; import org.powermock.api.easymock.PowerMock; import org.powermock.reflect.Whitebox; -import java.util.ArrayList; - -import static org.easymock.EasyMock.*; - public class RuleMgtWrapperTest { @Rule @@ -48,10 +49,10 @@ public class RuleMgtWrapperTest { } @Test - public void queryRuleByEnable_ruletemp_is_null() throws DbException { + public void queryRuleByEnable_ruletemp_is_null() throws CorrelationException { int enable = 3; - thrown.expect(DbException.class); + thrown.expect(CorrelationException.class); CorrelationRuleDao correlationRuleDao = PowerMock.createMock(CorrelationRuleDao.class); expect(daoUtil.getJdbiDaoByOnDemand(anyObject(Class.class))).andReturn(correlationRuleDao); @@ -62,7 +63,7 @@ public class RuleMgtWrapperTest { } @Test - public void queryRuleByEnable_normal() throws DbException { + public void queryRuleByEnable_normal() throws CorrelationException { int enable = 3; CorrelationRuleDao correlationRuleDao = PowerMock.createMock(CorrelationRuleDao.class); -- cgit 1.2.3-korg