Adding Junit 57/36957/1
authorAS00465059 <AS00465059@techmahindra.com>
Tue, 20 Mar 2018 07:05:19 +0000 (12:35 +0530)
committerAS00465059 <AS00465059@techmahindra.com>
Tue, 20 Mar 2018 07:05:19 +0000 (12:35 +0530)
Adding Junit for:
1.BpmnParam.java
2.BpmnRestClient.java
3.ResourceInput.java
4.ResourceRecipeRequest.java

Sonar link:
https://sonar.onap.org/code?id=org.onap.so%3Aso&selected=org.onap.so%3AMSOCommonBPMN%3Asrc%2Fmain%2Fjava%2Forg%2Fopenecomp%2Fmso%2Fbpmn%2Fcommon%2Frecipe

Change-Id: Icb2c545cb62a49fdd84ce998aa43792436aeaf41
Issue-ID: SO-491
Signed-off-by: AS00465059 <AS00465059@techmahindra.com>
bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/recipe/BpmnParamTest.java [new file with mode: 0644]
bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/recipe/BpmnRestClientTest.java [new file with mode: 0644]
bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/recipe/ResourceInputTest.java [new file with mode: 0644]
bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/recipe/ResourceRecipeRequestTest.java [new file with mode: 0644]

diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/recipe/BpmnParamTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/recipe/BpmnParamTest.java
new file mode 100644 (file)
index 0000000..166e3d7
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+* ============LICENSE_START=======================================================
+* ONAP : SO
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* 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
+*
+* 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.bpmn.common.recipe;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+public class BpmnParamTest {
+
+       BpmnParam bp=new BpmnParam();
+       
+       @Test
+       public void test() {
+               bp.setValue("testdata");
+           assertEquals(bp.getValue(),"testdata");
+       }
+       @Test
+       public void testToString(){
+               assert(bp.toString()!=null);
+       }
+
+}
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/recipe/BpmnRestClientTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/recipe/BpmnRestClientTest.java
new file mode 100644 (file)
index 0000000..89f538b
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+* ============LICENSE_START=======================================================
+* ONAP : SO
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* 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
+*
+* 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.bpmn.common.recipe;
+
+import static org.junit.Assert.*;
+import org.junit.Test;
+
+public class BpmnRestClientTest {
+       
+       @Test
+       public void test() {
+               BpmnRestClient.getEncryptedPropValue("prop", "123", "456");
+               BpmnRestClient.loadMsoProperties();
+               assertEquals(true,BpmnRestClient.getNoPropertiesState());
+       }
+}
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/recipe/ResourceInputTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/recipe/ResourceInputTest.java
new file mode 100644 (file)
index 0000000..fe1975f
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+* ============LICENSE_START=======================================================
+* ONAP : SO
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* 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
+*
+* 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.bpmn.common.recipe;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+
+public class ResourceInputTest {
+   
+       ResourceInput ri=new ResourceInput();
+       @Test
+       public void test() {
+               ri.setResourceInstanceName("resourceInstanceName");
+               ri.setResourceInstanceDes("resourceInstanceDes");
+               ri.setGlobalSubscriberId("globalSubscriberId");
+               ri.setServiceType("serviceType");
+               ri.setServiceInstanceId("serviceId");
+               ri.setOperationId("operationId");
+               ri.setResourceInvariantUuid("resourceInvariantUuid");
+               ri.setResourceUuid("resourceUuid");
+               ri.setResourceCustomizationUuid("resourceCustomizationUuid");
+               ri.setResourceInstancenUuid("resourceInstancenUuid");
+               ri.setResourceParameters("resourceParameters");
+               ri.setOperationType("operationType");
+               assertEquals(ri.getResourceInstanceName(), "resourceInstanceName");
+               assertEquals(ri.getResourceInstanceDes(), "resourceInstanceDes");
+               assertEquals(ri.getGlobalSubscriberId(), "globalSubscriberId");
+               assertEquals(ri.getServiceType(), "serviceType");
+               assertEquals(ri.getServiceInstanceId(), "serviceId");
+               assertEquals(ri.getOperationId(), "operationId");
+               assertEquals(ri.getResourceInvariantUuid(), "resourceInvariantUuid");
+               assertEquals(ri.getResourceUuid(), "resourceUuid");
+               assertEquals(ri.getResourceCustomizationUuid(), "resourceCustomizationUuid");
+               assertEquals(ri.getResourceInstancenUuid(), "resourceInstancenUuid");
+               assertEquals(ri.getResourceParameters(), "resourceParameters");
+               assertEquals(ri.getOperationType(), "operationType");
+               }
+       @Test
+       public void testToString(){
+               assert(ri.toString()!=null);
+       }
+}
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/recipe/ResourceRecipeRequestTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/recipe/ResourceRecipeRequestTest.java
new file mode 100644 (file)
index 0000000..3b185ba
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+* ============LICENSE_START=======================================================
+* ONAP : SO
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* 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
+*
+* 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.bpmn.common.recipe;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+
+public class ResourceRecipeRequestTest {
+
+       ResourceRecipeRequest rr=new ResourceRecipeRequest();
+       BpmnParam bp=new BpmnParam();
+       @Test
+       public void test() {
+               rr.setResourceInput(bp);
+               rr.setHost(bp);
+               rr.setRequestId(bp);
+               rr.setRequestAction(bp);
+               rr.setServiceInstanceId(bp);
+               rr.setServiceType(bp);
+               rr.setRecipeParams(bp);
+               assertEquals(rr.getResourceInput(),bp);
+               assertEquals(rr.getHost(),bp);
+               assertEquals(rr.getRequestId(),bp);
+               assertEquals(rr.getRequestAction(),bp);
+               assertEquals(rr.getServiceInstanceId(),bp);
+               assertEquals(rr.getServiceType(),bp);
+               assertEquals(rr.getRecipeParams(),bp);
+       }
+       @Test
+       public void testToString(){
+               assert(rr.toString()!=null);
+       }
+}