UT for mso adapters vnf 23/39723/1
authorSindhu A <arcot.sindhuri@huawei.com>
Wed, 28 Mar 2018 15:48:17 +0000 (15:48 +0000)
committerSindhu A <arcot.sindhuri@huawei.com>
Wed, 28 Mar 2018 15:49:37 +0000 (15:49 +0000)
UT for mso adapters vnf BpelRestClient

Issue-ID: SO-369

Change-Id: If3620ccba87f8f7e6bbe7bbde5e6a1bb220b65f2
Signed-off-by: Sindhu A <arcot.sindhuri@huawei.com>
adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/BpelRestClientTest.java [new file with mode: 0644]

diff --git a/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/BpelRestClientTest.java b/adapters/mso-vnf-adapter/src/test/java/org/openecomp/mso/adapters/vnf/BpelRestClientTest.java
new file mode 100644 (file)
index 0000000..445ca54
--- /dev/null
@@ -0,0 +1,52 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *l
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.adapters.vnf;
+
+import org.junit.Test;
+
+import static junit.framework.TestCase.assertEquals;
+import static junit.framework.TestCase.assertTrue;
+
+public class BpelRestClientTest {
+
+    @Test
+    public void testBpelRestClient() {
+
+        BpelRestClient test = new BpelRestClient();
+
+        assertEquals(test.getSocketTimeout(),5);
+        assertEquals(test.getConnectTimeout(),5);
+        assertEquals(test.getRetryCount(),5);
+        test.setRetryCount(6);
+        assertEquals(test.getRetryCount(),6);
+        assertEquals(test.getRetryInterval(),-15);
+        test.setRetryInterval(5);
+        assertEquals(test.getRetryInterval(),5);
+        test.setCredentials("credentials");
+        assertEquals(test.getCredentials(),"credentials");
+        test.setRetryList("1, 2, 3");
+        assertEquals(test.getRetryList(),"1, 2, 3");
+        assertEquals(test.getLastResponseCode(),0);
+        assertEquals(test.getLastResponse(),"");
+        assertTrue(test.bpelPost("bpelStr","url",true));
+
+    }
+}