summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMurali-P <murali.p@huawei.com>2017-02-15 20:37:01 +0530
committerMurali-P <murali.p@huawei.com>2017-02-15 20:37:01 +0530
commitbb5382a54c7d552cc1c7e53d8bcc0db5dd852db8 (patch)
tree52281ac3294043e9edb3811afda4f0f68b16640a
parent1e0674e4886889606e6e08e4424d5497ae29b8d5 (diff)
UT Test case fix
Resolved:VNFSDK-21 VNF SDK Function test Change-Id: I9fe03e01c0d0203318aeb1d5764dcae4da80e6b8 Signed-off-by: Murali-P <murali.p@huawei.com>
-rw-r--r--vnf-sdk-function-test/src/test/java/org/openo/vnfsdk/functest/externalservice/msb/MicroserviceBusConsumerTest.java28
1 files changed, 15 insertions, 13 deletions
diff --git a/vnf-sdk-function-test/src/test/java/org/openo/vnfsdk/functest/externalservice/msb/MicroserviceBusConsumerTest.java b/vnf-sdk-function-test/src/test/java/org/openo/vnfsdk/functest/externalservice/msb/MicroserviceBusConsumerTest.java
index b047633..8250700 100644
--- a/vnf-sdk-function-test/src/test/java/org/openo/vnfsdk/functest/externalservice/msb/MicroserviceBusConsumerTest.java
+++ b/vnf-sdk-function-test/src/test/java/org/openo/vnfsdk/functest/externalservice/msb/MicroserviceBusConsumerTest.java
@@ -16,25 +16,27 @@
package org.openo.vnfsdk.functest.externalservice.msb;
-import org.glassfish.jersey.client.ClientConfig;
+import javax.ws.rs.ProcessingException;
+
import org.junit.Test;
-import org.mockito.Mockito;
+import org.openo.vnfsdk.functest.VnfSdkFuncTestAppConfiguration;
+import org.openo.vnfsdk.functest.common.Config;
import org.openo.vnfsdk.functest.externalservice.entity.ServiceRegisterEntity;
-import org.openo.vnfsdk.functest.externalservice.msb.MicroserviceBusConsumer;
-import org.openo.vnfsdk.functest.externalservice.msb.MicroserviceBusRest;
-import org.powermock.api.mockito.PowerMockito;
-
-import com.eclipsesource.jaxrs.consumer.ConsumerFactory;
public class MicroserviceBusConsumerTest {
@Test
public void testRegisterService() {
- ServiceRegisterEntity entity = Mockito.mock(ServiceRegisterEntity.class);
- Mockito.mock(MicroserviceBusRest.class);
- Mockito.mock(ClientConfig.class);
- PowerMockito.mockStatic(ConsumerFactory.class);
- PowerMockito.mockStatic(MicroserviceBusConsumer.class);
- MicroserviceBusConsumer.registerService(entity);
+
+ try {
+ ServiceRegisterEntity entity = new ServiceRegisterEntity();
+ VnfSdkFuncTestAppConfiguration oConfig = new VnfSdkFuncTestAppConfiguration();
+ oConfig.setMsbServerAddr("http://127.0.0.1");
+ Config.setConfigration(oConfig);
+
+ MicroserviceBusConsumer.registerService(entity);
+ } catch(ProcessingException e) {
+ // Connect to MSB will fail, Connect refused is OK
+ }
}
}