Fixed the Start-up Failure in the Dualstack Env
[holmes/rule-management.git] / rulemgt / src / test / java / org / onap / holmes / rulemgt / bolt / enginebolt / EngineServiceTest.java
index 82e51a5..e581699 100644 (file)
@@ -1,12 +1,12 @@
 /**\r
  * Copyright 2017 ZTE Corporation.\r
- *\r
+ * <p>\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
  * You may obtain a copy of the License at\r
- *\r
- *     http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
+ * <p>\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ * <p>\r
  * Unless required by applicable law or agreed to in writing, software\r
  * distributed under the License is distributed on an "AS IS" BASIS,\r
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
 package org.onap.holmes.rulemgt.bolt.enginebolt;\r
 \r
 \r
-import static org.hamcrest.MatcherAssert.assertThat;\r
-import static org.hamcrest.Matchers.equalTo;\r
-\r
-import java.util.HashMap;\r
 import org.apache.http.HttpResponse;\r
 import org.apache.http.client.methods.CloseableHttpResponse;\r
 import org.apache.http.impl.client.CloseableHttpClient;\r
@@ -30,22 +26,27 @@ import org.junit.Before;
 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.utils.HttpsUtils;\r
 import org.onap.holmes.rulemgt.bean.request.CorrelationDeployRule4Engine;\r
 import org.powermock.api.easymock.PowerMock;\r
 import org.powermock.core.classloader.annotations.PowerMockIgnore;\r
 import org.powermock.core.classloader.annotations.PrepareForTest;\r
-import org.powermock.modules.junit4.rule.PowerMockRule;\r
+import org.powermock.modules.junit4.PowerMockRunner;\r
 import org.powermock.reflect.Whitebox;\r
 \r
+import java.util.HashMap;\r
+\r
+import static org.hamcrest.MatcherAssert.assertThat;\r
+import static org.hamcrest.Matchers.equalTo;\r
+\r
 @PrepareForTest({HttpClients.class, CloseableHttpClient.class, HttpsUtils.class})\r
 @PowerMockIgnore("javax.net.ssl.*")\r
+@RunWith(PowerMockRunner.class)\r
 public class EngineServiceTest {\r
 \r
     @Rule\r
     public ExpectedException thrown = ExpectedException.none();\r
-    @Rule\r
-    public PowerMockRule powerMockRule = new PowerMockRule();\r
     private EngineService engineService;\r
     private HttpResponse httpResponseMock;\r
     private CloseableHttpClient closeableHttpClient;\r