Junit for apihandlerinfra.volumebeans 63/39463/2
authorSumapriya <SS00493505@techmahindra.com>
Wed, 28 Mar 2018 06:58:38 +0000 (12:28 +0530)
committerRob Daugherty <rd472p@att.com>
Wed, 28 Mar 2018 18:02:17 +0000 (18:02 +0000)
Junit for:
1.ObjectFactory.java
2.RequestInfo.java
3.VolumeInputs.java
4.VolumeOutputs.java
5.VolumeRequests.java
6.VolumeRequest.java

Sonar Link:
https://sonar.onap.org/code?id=org.onap.so%3Aso&selected=org.onap.so%3Amso-api-handler-infra%3Asrc%2Fmain%2Fjava%2Forg%2Fopenecomp%2Fmso%2Fapihandlerinfra%2Fvolumebeans

Change-Id: Id2eea3ba913651d30bd8d5535c48d09dbea0d892
Issue-ID: SO-539
Signed-off-by: Sumapriya <SS00493505@techmahindra.com>
mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/volumebeans/ObjectFactoryTest.java [new file with mode: 0644]
mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/volumebeans/RequestInfoTest.java [new file with mode: 0644]
mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/volumebeans/VolumeInputsTest.java [new file with mode: 0644]
mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/volumebeans/VolumeOutputsTest.java [new file with mode: 0644]
mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/volumebeans/VolumeRequestTest.java [new file with mode: 0644]
mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/volumebeans/VolumeRequestsTest.java [new file with mode: 0644]

diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/volumebeans/ObjectFactoryTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/volumebeans/ObjectFactoryTest.java
new file mode 100644 (file)
index 0000000..228fc2f
--- /dev/null
@@ -0,0 +1,38 @@
+/*\r
+* ============LICENSE_START=======================================================\r
+* ONAP : SO\r
+* ================================================================================\r
+* Copyright 2018 TechMahindra\r
+*=================================================================================\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
+* 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
+* ============LICENSE_END=========================================================\r
+*/\r
+package org.openecomp.mso.apihandlerinfra.volumebeans;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+import org.junit.Test;\r
+\r
+public class ObjectFactoryTest {\r
+       ObjectFactory of = new ObjectFactory();\r
+       Object o = new Object();\r
+       @Test\r
+       public void testObjectFactory() {\r
+               of.createRequestInfo();\r
+               of.createVolumeRequest();\r
+               of.createVolumeInputs();\r
+               of.createVolumeOutputs();\r
+               of.createVolumeRequests();\r
+               of.createVolumeParams(o);\r
+               }\r
+}\r
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/volumebeans/RequestInfoTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/volumebeans/RequestInfoTest.java
new file mode 100644 (file)
index 0000000..b452c91
--- /dev/null
@@ -0,0 +1,50 @@
+/*\r
+* ============LICENSE_START=======================================================\r
+* ONAP : SO\r
+* ================================================================================\r
+* Copyright 2018 TechMahindra\r
+*=================================================================================\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
+* 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
+* ============LICENSE_END=========================================================\r
+*/\r
+package org.openecomp.mso.apihandlerinfra.volumebeans;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+import org.junit.Test;\r
+\r
+public class RequestInfoTest {\r
+       RequestInfo ri = new RequestInfo();\r
+       ActionType actiontype = ActionType.CREATE;\r
+       RequestStatusType requestStatustype = RequestStatusType.COMPLETE;\r
+       int abc;\r
+       @Test\r
+       public void testRequestInfo() {\r
+               ri.setRequestId("requestId");\r
+               ri.setAction(actiontype);\r
+               ri.setRequestStatus(requestStatustype);\r
+               ri.setStatusMessage("statusMessage");\r
+               ri.setProgress(abc);\r
+               ri.setStartTime("startTime");\r
+               ri.setEndTime("endTime");\r
+               ri.setSource("source");\r
+               assertEquals(ri.getRequestId(), "requestId");\r
+               assertEquals(ri.getAction(), actiontype);\r
+               assertEquals(ri.getRequestStatus(), requestStatustype);\r
+               assertEquals(ri.getStatusMessage(), "statusMessage");\r
+               assert(ri.getProgress().equals(abc));\r
+               assertEquals(ri.getStartTime(), "startTime");\r
+               assertEquals(ri.getEndTime(), "endTime");\r
+               assertEquals(ri.getSource(), "source"); \r
+       }\r
+}\r
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/volumebeans/VolumeInputsTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/volumebeans/VolumeInputsTest.java
new file mode 100644 (file)
index 0000000..8fd3ea0
--- /dev/null
@@ -0,0 +1,58 @@
+/*\r
+* ============LICENSE_START=======================================================\r
+* ONAP : SO\r
+* ================================================================================\r
+* Copyright 2018 TechMahindra\r
+*=================================================================================\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
+* 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
+* ============LICENSE_END=========================================================\r
+*/\r
+package org.openecomp.mso.apihandlerinfra.volumebeans;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+import org.junit.Test;\r
+\r
+public class VolumeInputsTest {\r
+       \r
+       VolumeInputs vi = new VolumeInputs();\r
+    @Test\r
+       public void testVolumeInputs() {\r
+               vi.setVolumeGroupId("volumeGroupId");\r
+               vi.setVolumeGroupName("volumeGroupName");\r
+               vi.setVnfType("vnfType");\r
+               vi.setVnfId("vnfId");\r
+               vi.setServiceInstanceId("serviceInstanceId");\r
+               vi.setServiceType("serviceType");\r
+               vi.setServiceId("serviceId");\r
+               vi.setAicNodeClli("aicNodeClli");\r
+               vi.setAicCloudRegion("aicCloudRegion");\r
+               vi.setTenantId("tenantId");\r
+               vi.setVfModuleModelName("vfModuleModelName");\r
+               vi.setAsdcServiceModelVersion("asdcServiceModelVersion");\r
+               vi.setBackoutOnFailure(true);\r
+               assertEquals(vi.getVolumeGroupId(), "volumeGroupId");\r
+               assertEquals(vi.getVolumeGroupName(), "volumeGroupName");\r
+               assertEquals(vi.getVnfType(), "vnfType");\r
+               assertEquals(vi.getVnfId(), "vnfId");\r
+               assertEquals(vi.getServiceInstanceId(), "serviceInstanceId");\r
+               assertEquals(vi.getServiceType(), "serviceType");\r
+               assertEquals(vi.getServiceId(), "serviceId");\r
+               assertEquals(vi.getAicNodeClli(), "aicNodeClli");\r
+               assertEquals(vi.getAicCloudRegion(), "aicCloudRegion");\r
+               assertEquals(vi.getTenantId(), "tenantId");\r
+               assertEquals(vi.getVfModuleModelName(), "vfModuleModelName");\r
+               assertEquals(vi.getAsdcServiceModelVersion(), "asdcServiceModelVersion");\r
+               assertEquals(vi.getBackoutOnFailure(), true);   \r
+       }\r
+}\r
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/volumebeans/VolumeOutputsTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/volumebeans/VolumeOutputsTest.java
new file mode 100644 (file)
index 0000000..f8a65bf
--- /dev/null
@@ -0,0 +1,44 @@
+/*\r
+* ============LICENSE_START=======================================================\r
+* ONAP : SO\r
+* ================================================================================\r
+* Copyright 2018 TechMahindra\r
+*=================================================================================\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
+* 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
+* ============LICENSE_END=========================================================\r
+*/\r
+package org.openecomp.mso.apihandlerinfra.volumebeans;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+import org.junit.Test;\r
+\r
+public class VolumeOutputsTest {\r
+       \r
+       VolumeOutputs vo = new VolumeOutputs();\r
+    @Test\r
+       public void testVolumeOutputs() {\r
+               vo.setVolumeGroupId("volumeGroupId");\r
+               vo.setVolumeGroupName("volumeGroupName");\r
+               vo.setVnfType("vnfType");\r
+               vo.setServiceType("serviceType");\r
+               vo.setAicNodeClli("aicNodeClli");\r
+               vo.setTenantId("tenantId");\r
+               assertEquals(vo.getVolumeGroupId(), "volumeGroupId");\r
+               assertEquals(vo.getVolumeGroupName(), "volumeGroupName");\r
+               assertEquals(vo.getVnfType(), "vnfType");\r
+               assertEquals(vo.getServiceType(), "serviceType");\r
+               assertEquals(vo.getAicNodeClli(), "aicNodeClli");\r
+               assertEquals(vo.getTenantId(), "tenantId");     \r
+       }\r
+}\r
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/volumebeans/VolumeRequestTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/volumebeans/VolumeRequestTest.java
new file mode 100644 (file)
index 0000000..1e0152e
--- /dev/null
@@ -0,0 +1,44 @@
+/*\r
+* ============LICENSE_START=======================================================\r
+* ONAP : SO\r
+* ================================================================================\r
+* Copyright 2018 TechMahindra\r
+*=================================================================================\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
+* 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
+* ============LICENSE_END=========================================================\r
+*/\r
+package org.openecomp.mso.apihandlerinfra.volumebeans;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+import org.junit.Test;\r
+\r
+public class VolumeRequestTest {\r
+       \r
+       VolumeRequest vr = new VolumeRequest();\r
+       RequestInfo ri = new RequestInfo();\r
+       VolumeInputs vi = new VolumeInputs();\r
+       VolumeOutputs vo = new VolumeOutputs();\r
+       Object o = new Object();\r
+       @Test\r
+       public void testVolumeRequest() {\r
+               vr.setRequestInfo(ri);\r
+               vr.setVolumeInputs(vi);\r
+               vr.setVolumeOutputs(vo);\r
+               vr.setVolumeParams(o);\r
+               assertEquals(vr.getRequestInfo(), ri);\r
+               assertEquals(vr.getVolumeInputs(), vi);\r
+               assertEquals(vr.getVolumeOutputs(), vo);\r
+               assertEquals(vr.getVolumeParams(), o);  \r
+       }\r
+}\r
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/volumebeans/VolumeRequestsTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/volumebeans/VolumeRequestsTest.java
new file mode 100644 (file)
index 0000000..0d2c603
--- /dev/null
@@ -0,0 +1,32 @@
+/*\r
+* ============LICENSE_START=======================================================\r
+* ONAP : SO\r
+* ================================================================================\r
+* Copyright 2018 TechMahindra\r
+*=================================================================================\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
+* 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
+* ============LICENSE_END=========================================================\r
+*/\r
+package org.openecomp.mso.apihandlerinfra.volumebeans;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+import org.junit.Test;\r
+\r
+public class VolumeRequestsTest {\r
+       VolumeRequests vrs = new VolumeRequests();\r
+       @Test\r
+       public void testVolumeRequests() {\r
+               vrs.getVolumeRequest(); \r
+       }\r
+}\r