Fixed MSB Registration Failure
[holmes/common.git] / holmes-actions / src / test / java / org / onap / holmes / common / utils / MSBRegisterUtilTest.java
diff --git a/holmes-actions/src/test/java/org/onap/holmes/common/utils/MSBRegisterUtilTest.java b/holmes-actions/src/test/java/org/onap/holmes/common/utils/MSBRegisterUtilTest.java
deleted file mode 100644 (file)
index e6b6f9d..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/**\r
- * Copyright 2017-2020 ZTE Corporation.\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
- * <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
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-package org.onap.holmes.common.utils;\r
-\r
-import org.easymock.EasyMock;\r
-import org.junit.Test;\r
-import org.junit.runner.RunWith;\r
-import org.onap.holmes.common.config.MicroServiceConfig;\r
-import org.onap.holmes.common.exception.CorrelationException;\r
-import org.onap.msb.sdk.discovery.entity.MicroServiceFullInfo;\r
-import org.onap.msb.sdk.discovery.entity.MicroServiceInfo;\r
-import org.onap.msb.sdk.httpclient.msb.MSBServiceClient;\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.PowerMockRunner;\r
-\r
-@PrepareForTest({MicroServiceConfig.class, MSBServiceClient.class, MSBRegisterUtil.class})\r
-@PowerMockIgnore({"javax.ws.*"})\r
-@RunWith(PowerMockRunner.class)\r
-public class MSBRegisterUtilTest {\r
-\r
-    private MSBRegisterUtil msbRegisterUtil = new MSBRegisterUtil();\r
-\r
-    @Test\r
-    public void test_register2Msb_normal() throws Exception {\r
-        MicroServiceInfo msi = new MicroServiceInfo();\r
-        String[] msbAddrInfo = {"127.0.0.1", "80"};\r
-\r
-        PowerMock.mockStatic(MicroServiceConfig.class);\r
-        EasyMock.expect(MicroServiceConfig.getMsbIpAndPort()).andReturn(msbAddrInfo);\r
-\r
-        MSBServiceClient client = PowerMock.createMock(MSBServiceClient.class);\r
-        PowerMock.expectNew(MSBServiceClient.class, msbAddrInfo[0], Integer.parseInt(msbAddrInfo[1])).andReturn(client);\r
-\r
-        EasyMock.expect(client.registerMicroServiceInfo(msi, false)).andReturn(null);\r
-\r
-        EasyMock.expect(client.registerMicroServiceInfo(msi, false)).andReturn(new MicroServiceFullInfo());\r
-\r
-        PowerMock.replayAll();\r
-\r
-        try {\r
-            msbRegisterUtil.register2Msb(msi);\r
-        } catch (CorrelationException e) {\r
-            // Do nothing\r
-        }\r
-\r
-        PowerMock.verifyAll();\r
-    }\r
-}
\ No newline at end of file