Updated to Java 11
[holmes/rule-management.git] / rulemgt / src / test / java / org / onap / holmes / rulemgt / db / CorrelationRuleQueryDaoTest.java
index e028a2c..0e97e3a 100644 (file)
@@ -1,5 +1,5 @@
 /**\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