/**\r
- * Copyright 2017 ZTE Corporation.\r
+ * Copyright 2017-2020 ZTE Corporation.\r
*\r
* Licensed under the Apache License, Version 2.0 (the "License");\r
* you may not use this file except in compliance with the License.\r
\r
package org.onap.holmes.rulemgt.db;\r
\r
-import static org.hamcrest.MatcherAssert.assertThat;\r
-import static org.hamcrest.Matchers.is;\r
-\r
-import java.util.ArrayList;\r
-import java.util.Date;\r
-import java.util.HashMap;\r
-import java.util.List;\r
-import java.util.Map;\r
-import java.util.Properties;\r
import org.easymock.EasyMock;\r
import org.junit.Before;\r
import org.junit.Rule;\r
import org.junit.Test;\r
import org.junit.rules.ExpectedException;\r
+import org.junit.runner.RunWith;\r
import org.onap.holmes.common.api.entity.CorrelationRule;\r
import org.onap.holmes.common.exception.CorrelationException;\r
import org.onap.holmes.common.utils.DbDaoUtil;\r
import org.onap.holmes.rulemgt.bean.request.RuleQueryCondition;\r
import org.powermock.api.easymock.PowerMock;\r
-import org.powermock.modules.junit4.rule.PowerMockRule;\r
+import org.powermock.core.classloader.annotations.PrepareForTest;\r
+import org.powermock.modules.junit4.PowerMockRunner;\r
import org.powermock.reflect.Whitebox;\r
import org.skife.jdbi.v2.Handle;\r
import org.skife.jdbi.v2.Query;\r
\r
+import java.util.*;\r
\r
+import static org.hamcrest.MatcherAssert.assertThat;\r
+import static org.hamcrest.Matchers.is;\r
+\r
+@RunWith(PowerMockRunner.class)\r
+@PrepareForTest({DbDaoUtil.class, Handle.class, Query.class})\r
public class CorrelationRuleQueryDaoTest {\r
\r
@Rule\r
public ExpectedException thrown = ExpectedException.none();\r
\r
- @Rule\r
- public PowerMockRule powerMockRule = new PowerMockRule();\r
private DbDaoUtil dbDaoUtil;\r
\r
private Handle handle;\r
value.put("rid", "rule_" + System.currentTimeMillis());\r
value.put("description", "desc");\r
value.put("enable", 0);\r
- value.put("templateID", 1);\r
+ value.put("templateID", 1L);\r
value.put("engineId", "engine-001");\r
value.put("engineType", "engineType-001");\r
value.put("creator", "admin");\r