--- /dev/null
+/*\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
+\r
+package org.openecomp.mso.bpmn.common.adapter.vnf;\r
+\r
+import static org.junit.Assert.*;\r
+import org.junit.Test;\r
+import org.openecomp.mso.bpmn.common.adapter.vnf.CreateVnfNotification.Outputs;\r
+import org.openecomp.mso.bpmn.common.adapter.vnf.CreateVnfNotification.Outputs.Entry;\r
+\r
+public class CreateVnfNotificationTest {\r
+\r
+ @Test\r
+ public void test() {\r
+ CreateVnfNotification cvn=new CreateVnfNotification();\r
+ Entry ent = new Entry();\r
+ MsoExceptionCategory exception = MsoExceptionCategory.OPENSTACK;\r
+ Outputs value=new Outputs();\r
+ VnfRollback vnf=new VnfRollback();\r
+ vnf.setCloudSiteId("cloud");\r
+ cvn.setCompleted(true);\r
+ cvn.setErrorMessage("emsg");\r
+ cvn.setException(exception);\r
+ cvn.setMessageId("id");\r
+ cvn.setOutputs(value);\r
+ ent.setKey("key");\r
+ ent.setValue("value");\r
+ cvn.setRollback(vnf);\r
+ cvn.setVnfId("vnf");\r
+ assertTrue(cvn.isCompleted());\r
+ assert(cvn.getErrorMessage().equals("emsg"));\r
+ assert(cvn.getException()).equals(exception);\r
+ assert(cvn.getMessageId()).equals("id");\r
+ assert(cvn.getRollback()).equals(vnf);\r
+ assert(cvn.getOutputs()).equals(value);\r
+ assert(cvn.getVnfId()).equals("vnf");\r
+ assert(ent.getKey()).equals("key");\r
+ assert(ent.getValue()).equals("value");\r
+ assert(ent.toString()!=null);\r
+ assert(cvn.toString()!=null);\r
+ assert(vnf.getCloudSiteId().equals("cloud"));\r
+ assert(value.getEntry()!=null); \r
+ }\r
+}\r
--- /dev/null
+/*\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
+\r
+package org.openecomp.mso.bpmn.common.adapter.vnf;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+import org.junit.Test;\r
+\r
+public class DeleteVnfNotificationTest {\r
+\r
+ @Test\r
+ public void test() {\r
+ DeleteVnfNotification dvn=new DeleteVnfNotification();\r
+ MsoExceptionCategory exception = MsoExceptionCategory.OPENSTACK;\r
+ dvn.setCompleted(true);\r
+ dvn.setErrorMessage("msg");\r
+ dvn.setMessageId("id");\r
+ dvn.setException(exception);\r
+ assert(dvn.getErrorMessage().equals("msg"));\r
+ assert(dvn.getMessageId().equals("id"));\r
+ assert(dvn.getException().equals(exception));\r
+ assert(dvn.toString()!=null);\r
+ assertTrue(dvn.isCompleted());\r
+ }\r
+}\r
--- /dev/null
+/*\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.bpmn.common.adapter.vnf;\r
+import static org.junit.Assert.assertEquals;\r
+import org.junit.Test;\r
+\r
+public class MsoRequestTest {\r
+ private MsoRequest msorequest = new MsoRequest();\r
+ @Test\r
+ public void testMsoRequest() {\r
+ msorequest.setRequestId("requestId");\r
+ msorequest.setServiceInstanceId("serviceInstanceId");\r
+ assertEquals(msorequest.getRequestId(), "requestId");\r
+ assertEquals(msorequest.getServiceInstanceId(), "serviceInstanceId");\r
+ }\r
+ @Test\r
+ public void testtoString() {\r
+ assert(msorequest.toString())!= null; \r
+ }\r
+}\r
--- /dev/null
+/*\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
+\r
+package org.openecomp.mso.bpmn.common.adapter.vnf;\r
+\r
+import static org.mockito.Mockito.mock;\r
+import org.junit.Test;\r
+import org.openecomp.mso.bpmn.common.adapter.vnf.CreateVnfNotification.Outputs;\r
+\r
+public class ObjectFactoryTest {\r
+ private ObjectFactory ofa=new ObjectFactory();\r
+ \r
+ @Test\r
+ public void test() { \r
+ CreateVnfNotification cvn=mock( CreateVnfNotification.class);\r
+ UpdateVnfNotification uvn=mock (UpdateVnfNotification.class);\r
+ QueryVnfNotification qn=mock(QueryVnfNotification.class);\r
+ DeleteVnfNotification dvn=mock( DeleteVnfNotification.class);\r
+ RollbackVnfNotification rvn=mock( RollbackVnfNotification.class);\r
+ MsoRequest mr=mock( MsoRequest.class);\r
+ Outputs opt=mock(Outputs.class);\r
+ ofa.createCreateVnfNotification();\r
+ ofa.createCreateVnfNotificationOutputs();\r
+ ofa.createDeleteVnfNotification();\r
+ ofa.createQueryVnfNotification();\r
+ ofa.createUpdateVnfNotification();\r
+ ofa.createMsoRequest();\r
+ ofa.createRollbackVnfNotification();\r
+ ofa.createUpdateVnfNotificationOutputs();\r
+ ofa.createQueryVnfNotificationOutputs();\r
+ ofa.createVnfRollback();\r
+ ofa.createUpdateVnfNotificationOutputsEntry();\r
+ ofa.createQueryVnfNotificationOutputsEntry();\r
+ ofa.createCreateVnfNotificationOutputsEntry();\r
+ ofa.createCreateVnfNotification(cvn);\r
+ ofa.createDeleteVnfNotification(dvn);\r
+ ofa.createQueryVnfNotification(qn);\r
+ ofa.createRollbackVnfNotification(rvn);\r
+ ofa.createUpdateVnfNotification(uvn); \r
+ }\r
+}\r
--- /dev/null
+/*\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
+\r
+package org.openecomp.mso.bpmn.common.adapter.vnf;\r
+\r
+import static org.junit.Assert.*;\r
+import org.junit.Test;\r
+import org.openecomp.mso.bpmn.common.adapter.vnf.CreateVnfNotification.Outputs;\r
+import org.openecomp.mso.bpmn.common.adapter.vnf.CreateVnfNotification.Outputs.Entry;\r
+\r
+public class QueryVnfNotificationTest {\r
+ private QueryVnfNotification qvn=new QueryVnfNotification();\r
+ \r
+ @Test\r
+ public void test() {\r
+ Entry ent = new Entry();\r
+ MsoExceptionCategory exception = MsoExceptionCategory.OPENSTACK;\r
+ Outputs opt=new Outputs();\r
+ VnfStatus vnf=VnfStatus.ACTIVE;\r
+ qvn.setCompleted(true);\r
+ qvn.setErrorMessage("error");\r
+ qvn.setException(exception);\r
+ qvn.setMessageId("id");\r
+ qvn.setStatus(vnf);\r
+ qvn.setVnfId("id");\r
+ qvn.setVnfExists(true);\r
+ ent.setKey("key");\r
+ ent.setValue("value");\r
+ assert(qvn.getErrorMessage().equals("error"));\r
+ assert(qvn.getException()).equals(exception);\r
+ assert(qvn.getMessageId()).equals("id");\r
+ assert(qvn.getStatus()).equals(vnf);\r
+ assert(qvn.getVnfId()).equals("id");\r
+ assertTrue(qvn.isVnfExists());\r
+ assertTrue(qvn.isCompleted());\r
+ assert(opt.getEntry()!=null);\r
+ assert(opt.toString()!=null);\r
+ assert(ent.getValue()).equals("value");\r
+ assert(ent.getKey()).equals("key");\r
+ assert(ent.toString()!=null);\r
+ assert(qvn.toString()!=null); \r
+ }\r
+}\r
--- /dev/null
+/*-\r
+ * ============LICENSE_START=======================================================\r
+ * ONAP - SO\r
+ * ================================================================================\r
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.\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.bpmn.common.adapter.vnf;\r
+\r
+import static org.junit.Assert.assertEquals;\r
+import org.junit.Test;\r
+\r
+public class RollbackVnfNotificationTest {\r
+ private RollbackVnfNotification rvn = new RollbackVnfNotification();\r
+ MsoExceptionCategory mso= MsoExceptionCategory.OPENSTACK;\r
+ @Test\r
+ public void testRollbackVnfNotification() {\r
+ rvn.setMessageId("messageId");\r
+ rvn.setCompleted(true);\r
+ rvn.setException(mso);\r
+ rvn.setErrorMessage("errorMessage");\r
+ assertEquals(rvn.getMessageId(), "messageId");\r
+ assertEquals(rvn.isCompleted(), true);\r
+ assertEquals(rvn.getException(), mso);\r
+ assertEquals(rvn.getErrorMessage(), "errorMessage");\r
+ }\r
+ @Test\r
+ public void testtoString() {\r
+ assert(rvn.toString()!=null);\r
+ }\r
+}\r
--- /dev/null
+/*\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
+\r
+package org.openecomp.mso.bpmn.common.adapter.vnf;\r
+\r
+import static org.junit.Assert.*;\r
+import org.junit.Test;\r
+import org.openecomp.mso.bpmn.common.adapter.vnf.UpdateVnfNotification.Outputs;\r
+import org.openecomp.mso.bpmn.common.adapter.vnf.UpdateVnfNotification.Outputs.Entry;\r
+\r
+public class UpdateVnfNotificationTest {\r
+ private UpdateVnfNotification updatevnf = new UpdateVnfNotification();\r
+ MsoExceptionCategory mso;\r
+ Outputs value= new Outputs();\r
+ VnfRollback roll = new VnfRollback();\r
+ private Entry entry = new Entry();\r
+ \r
+ @Test\r
+ public void testUpdateVnfNotification() {\r
+ updatevnf.setMessageId("messageId");\r
+ updatevnf.setCompleted(true);\r
+ updatevnf.setException(mso);\r
+ updatevnf.setErrorMessage("errorMessage");\r
+ updatevnf.setOutputs(value);\r
+ updatevnf.setRollback(roll);\r
+ entry.setKey("key");\r
+ entry.setValue("value");\r
+ assertEquals(updatevnf.getMessageId(), "messageId");\r
+ assertEquals(updatevnf.isCompleted(), true);\r
+ assertEquals(updatevnf.getException(), mso);\r
+ assertEquals(updatevnf.getErrorMessage(), "errorMessage");\r
+ assertEquals(updatevnf.getOutputs(), value);\r
+ assertEquals(updatevnf.getRollback(), roll);\r
+ assertEquals(entry.getKey(), "key");\r
+ assertEquals(entry.getValue(), "value"); \r
+ }\r
+ @Test\r
+ public void testtoString() {\r
+ assert(updatevnf.toString()!= null);\r
+ assert(entry.toString()!= null);\r
+ }\r
+}\r
--- /dev/null
+/*\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
+\r
+package org.openecomp.mso.bpmn.common.adapter.vnf;\r
+\r
+import static org.junit.Assert.assertEquals;\r
+import org.junit.Test;\r
+\r
+public class VnfRollbackTest {\r
+ private VnfRollback vnfrollback = new VnfRollback();\r
+ MsoRequest mso = new MsoRequest();\r
+ @Test\r
+ public void testVnfRollback() {\r
+ vnfrollback.setCloudSiteId("cloudSiteId");\r
+ vnfrollback.setMsoRequest(mso);\r
+ vnfrollback.setTenantCreated(true);\r
+ vnfrollback.setTenantId("tenantId");\r
+ vnfrollback.setVnfCreated(true);\r
+ vnfrollback.setVnfId("vnfId");\r
+ assertEquals(vnfrollback.getCloudSiteId(), "cloudSiteId");\r
+ assertEquals(vnfrollback.getMsoRequest(), mso);\r
+ assertEquals(vnfrollback.isTenantCreated(), true);\r
+ assertEquals(vnfrollback.getTenantId(), "tenantId");\r
+ assertEquals(vnfrollback.isVnfCreated(), true);\r
+ assertEquals(vnfrollback.getVnfId(), "vnfId"); \r
+ }\r
+ @Test\r
+ public void testtoString() {\r
+ assert(vnfrollback.toString() != null);\r
+ }\r
+}\r