--- /dev/null
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2018 Huawei Intellectual Property. 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
+ *
+ * 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.apihandlerinfra.networkbeans;
+
+import org.junit.Test;
+
+public class NetworkOutputsTest {
+ // TODO: currently test case is done for coverage
+ // later, it should be modified properly.
+
+ NetworkOutputs test = new NetworkOutputs();
+
+ @Test
+ public void getNetworkIdTest() throws Exception {
+ test.getNetworkId();
+ }
+
+ @Test
+ public void setNetworkIdTest() throws Exception {
+ test.setNetworkId("id");
+ }
+
+ @Test
+ public void getNetworkNameTest() throws Exception {
+ test.getNetworkName();
+ }
+
+ @Test
+ public void setNetworkNameTest() throws Exception {
+ test.setNetworkName("name");
+ }
+}
--- /dev/null
+/*-\r
+ * ============LICENSE_START=======================================================\r
+ * ONAP - SO\r
+ * ================================================================================\r
+ * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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
+\r
+package org.openecomp.mso.apihandlerinfra.tasksbeans;\r
+\r
+import org.junit.After;\r
+import static org.junit.Assert.assertTrue;\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+import static org.mockito.Mockito.mock;\r
+import static org.mockito.Mockito.verify;\r
+import static org.mockito.Mockito.when;\r
+\r
+\r
+public class RequestDetailsTest {\r
+\r
+ RequestDetails _requestDetails;\r
+ RequestInfo _requestInfo;\r
+\r
+ public RequestDetailsTest() {\r
+ }\r
+\r
+ @Before\r
+ public void setUp() {\r
+ _requestDetails = mock(RequestDetails.class);\r
+ _requestInfo = new RequestInfo();\r
+ when(_requestDetails.getRequestInfo()).thenReturn(_requestInfo);\r
+ }\r
+\r
+ @After\r
+ public void tearDown() {\r
+ _requestDetails = null;\r
+ _requestInfo = null;\r
+ }\r
+\r
+ /**\r
+ * Test of getRequestInfo method\r
+ */\r
+ @Test\r
+ public void testGetRequestInfo() {\r
+ _requestDetails.setRequestInfo(_requestInfo);\r
+ assertTrue(_requestDetails.getRequestInfo().equals(_requestInfo));\r
+\r
+ }\r
+\r
+ /**\r
+ * Test setRequestInfo\r
+ */\r
+ @Test\r
+ public void testSetRequestInfo() {\r
+ _requestDetails.setRequestInfo(_requestInfo);\r
+ verify(_requestDetails).setRequestInfo(_requestInfo);\r
+ }\r
+}\r
--- /dev/null
+/*-\r
+ * ============LICENSE_START=======================================================\r
+ * ONAP - SO\r
+ * ================================================================================\r
+ * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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
+\r
+package org.openecomp.mso.apihandlerinfra.tasksbeans;\r
+\r
+import org.junit.After;\r
+\r
+import static org.junit.Assert.assertEquals;\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+\r
+import static org.mockito.Mockito.mock;\r
+import static org.mockito.Mockito.verify;\r
+import static org.mockito.Mockito.when;\r
+\r
+public class RequestInfoTest {\r
+\r
+ RequestInfo _requestInfo;\r
+ String _source;\r
+ ValidResponses _responseValue;\r
+ String _requestorId;\r
+\r
+ public RequestInfoTest() {\r
+ }\r
+\r
+ @Before\r
+ public void setUp() {\r
+ _requestInfo = mock(RequestInfo.class);\r
+ _responseValue = ValidResponses.abort;\r
+ _requestorId = "ab1234";\r
+ _source = "VID";\r
+ when(_requestInfo.getRequestorId()).thenReturn(_requestorId);\r
+ when(_requestInfo.getSource()).thenReturn(_source);\r
+ when(_requestInfo.getResponseValue()).thenReturn(_responseValue);\r
+\r
+ }\r
+\r
+ @After\r
+ public void tearDown() {\r
+ _requestInfo = null;\r
+ _responseValue = null;\r
+ }\r
+\r
+ /**\r
+ * Test of getSource method\r
+ */\r
+ @Test\r
+ public void testGetSource() {\r
+ String result = _requestInfo.getSource();\r
+ assertEquals(_source, result);\r
+\r
+ }\r
+\r
+ /**\r
+ * Test setSource\r
+ */\r
+ @Test\r
+ public void testSetSource() {\r
+ _requestInfo.setSource("VID");\r
+ verify(_requestInfo).setSource(_source);\r
+ }\r
+ \r
+ /**\r
+ * Test of getRequestorId method\r
+ */\r
+ @Test\r
+ public void testGetRequestorId() {\r
+ String result = _requestInfo.getRequestorId();\r
+ assertEquals(_requestorId, result);\r
+\r
+ }\r
+\r
+ /**\r
+ * Test setRequestInfo\r
+ */\r
+ @Test\r
+ public void testSetRequestorId() {\r
+ _requestInfo.setRequestorId(_requestorId);\r
+ verify(_requestInfo).setRequestorId(_requestorId);\r
+ }\r
+ \r
+\r
+ /**\r
+ * Test of getResponseValue method\r
+ */\r
+ @Test\r
+ public void testGetResponseValue() {\r
+ ValidResponses result = _requestInfo.getResponseValue();\r
+ assertEquals(_responseValue, result);\r
+\r
+ }\r
+\r
+ /**\r
+ * Test setResponseValues method\r
+ */\r
+ @Test\r
+ public void testSetResponseValue() {\r
+ _requestInfo.setResponseValue(ValidResponses.abort);\r
+ verify(_requestInfo).setResponseValue(_responseValue);\r
+ }\r
+}\r
--- /dev/null
+/*-\r
+ * ============LICENSE_START=======================================================\r
+ * ONAP - SO\r
+ * ================================================================================\r
+ * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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
+\r
+package org.openecomp.mso.apihandlerinfra.tasksbeans;\r
+\r
+import org.junit.After;\r
+\r
+import static org.junit.Assert.assertEquals;\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+import static org.mockito.Mockito.mock;\r
+import static org.mockito.Mockito.verify;\r
+import static org.mockito.Mockito.when;\r
+import org.json.JSONArray;\r
+\r
+public class TaskListTest {\r
+\r
+ TaskList _taskList;\r
+ protected String _taskId;\r
+ protected String _type;\r
+ protected String _nfRole;\r
+ protected String _subscriptionServiceType;\r
+ protected String _originalRequestId;\r
+ protected String _originalRequestorId;\r
+ protected String _errorSource;\r
+ protected String _errorCode;\r
+ protected String _errorMessage;\r
+ protected String _buildingBlockName;\r
+ protected String _buildingBlockStep;\r
+ protected JSONArray _validResponses;\r
+\r
+ public TaskListTest() {\r
+ }\r
+\r
+ @Before\r
+ public void setUp() {\r
+ _taskList = mock(TaskList.class);\r
+ _taskId = "_taskid";\r
+ _type = "type";\r
+ _nfRole = "nfrole";\r
+ _subscriptionServiceType = "subscriptionservicetype";\r
+ _originalRequestId = "originalrequestid";\r
+ _originalRequestorId = "originalrequestorid";\r
+ _errorSource = "errorsource";\r
+ _errorCode = "errorcode";\r
+ _errorMessage = "errormessage";\r
+ _buildingBlockName = "buildingblockname";\r
+ _buildingBlockStep = "buildingblockstep";\r
+ _validResponses = mock(JSONArray.class);\r
+\r
+ when(_taskList.getTaskId()).thenReturn(_taskId);\r
+ when(_taskList.getType()).thenReturn(_type);\r
+ when(_taskList.getNfRole()).thenReturn(_nfRole);\r
+ when(_taskList.getSubscriptionServiceType()).thenReturn(_subscriptionServiceType);\r
+ when(_taskList.getOriginalRequestId()).thenReturn(_originalRequestId);\r
+ when(_taskList.getOriginalRequestorId()).thenReturn(_originalRequestorId);\r
+ when(_taskList.getErrorSource()).thenReturn(_errorSource);\r
+ when(_taskList.getErrorCode()).thenReturn(_errorCode);\r
+ when(_taskList.getErrorMessage()).thenReturn(_errorMessage);\r
+ when(_taskList.getBuildingBlockName()).thenReturn(_buildingBlockName);\r
+ when(_taskList.getBuildingBlockStep()).thenReturn(_buildingBlockStep);\r
+ when(_taskList.getValidResponses()).thenReturn(_validResponses);\r
+ }\r
+\r
+ @After\r
+ public void tearDown() {\r
+ _taskList = null;\r
+ _validResponses = null;\r
+ }\r
+\r
+ @Test\r
+ public void testGetTaskId() {\r
+ String result = _taskList.getTaskId();\r
+ assertEquals(_taskId, result);\r
+\r
+ }\r
+\r
+ @Test\r
+ public void testSetTaskId() {\r
+ _taskList.setTaskId("_taskid");\r
+ verify(_taskList).setTaskId(_taskId);\r
+ }\r
+\r
+ @Test\r
+ public void testGetType() {\r
+ String result = _taskList.getType();\r
+ assertEquals(_type, result);\r
+\r
+ }\r
+\r
+ @Test\r
+ public void testSetType() {\r
+ _taskList.setType(_type);\r
+ verify(_taskList).setType(_type);\r
+ }\r
+\r
+ @Test\r
+ public void testGetNfRole() {\r
+ String result = _taskList.getNfRole();\r
+ assertEquals(_nfRole, result);\r
+\r
+ }\r
+\r
+ @Test\r
+ public void testSetNfRole() {\r
+ _taskList.setType(_nfRole);\r
+ verify(_taskList).setType(_nfRole);\r
+ }\r
+\r
+ @Test\r
+ public void testGetSubscriptionServiceType() {\r
+ String result = _taskList.getSubscriptionServiceType();\r
+ assertEquals(_subscriptionServiceType, result);\r
+\r
+ }\r
+\r
+ @Test\r
+ public void testSetSubscriptionServiceType() {\r
+ _taskList.setSubscriptionServiceType(_subscriptionServiceType);\r
+ verify(_taskList).setSubscriptionServiceType(_subscriptionServiceType);\r
+ }\r
+\r
+ @Test\r
+ public void testGetOriginalRequestId() {\r
+ String result = _taskList.getOriginalRequestId();\r
+ assertEquals(_originalRequestId, result);\r
+\r
+ }\r
+\r
+ @Test\r
+ public void testSetOriginalRequestId() {\r
+ _taskList.setOriginalRequestId(_originalRequestId);\r
+ verify(_taskList).setOriginalRequestId(_originalRequestId);\r
+ }\r
+\r
+ @Test\r
+ public void testGetOriginalRequestorId() {\r
+ String result = _taskList.getOriginalRequestorId();\r
+ assertEquals(_originalRequestorId, result);\r
+\r
+ }\r
+\r
+ @Test\r
+ public void testSetOriginalRequestorId() {\r
+ _taskList.setOriginalRequestorId(_originalRequestorId);\r
+ verify(_taskList).setOriginalRequestorId(_originalRequestorId);\r
+ }\r
+\r
+ @Test\r
+ public void testGetErrorSource() {\r
+ String result = _taskList.getErrorSource();\r
+ assertEquals(_errorSource, result);\r
+\r
+ }\r
+\r
+ @Test\r
+ public void testSetErrorSource() {\r
+ _taskList.setErrorSource(_errorSource);\r
+ verify(_taskList).setErrorSource(_errorSource);\r
+ }\r
+\r
+ @Test\r
+ public void testGetErrorCode() {\r
+ String result = _taskList.getErrorCode();\r
+ assertEquals(_errorCode, result);\r
+\r
+ }\r
+\r
+ @Test\r
+ public void testSetErrorCode() {\r
+ _taskList.setErrorCode(_errorCode);\r
+ verify(_taskList).setErrorCode(_errorCode);\r
+ }\r
+\r
+ @Test\r
+ public void testGetErrorMessage() {\r
+ String result = _taskList.getErrorMessage();\r
+ assertEquals(_errorMessage, result);\r
+\r
+ }\r
+\r
+ @Test\r
+ public void testSetErrorMessage() {\r
+ _taskList.setErrorMessage(_errorMessage);\r
+ verify(_taskList).setErrorMessage(_errorMessage);\r
+ }\r
+\r
+ @Test\r
+ public void testGetBuildingBlockName() {\r
+ String result = _taskList.getBuildingBlockName();\r
+ assertEquals(_buildingBlockName, result);\r
+\r
+ }\r
+\r
+ @Test\r
+ public void testSetBuildingBlockName() {\r
+ _taskList.setBuildingBlockName(_buildingBlockName);\r
+ verify(_taskList).setBuildingBlockName(_buildingBlockName);\r
+ }\r
+\r
+ @Test\r
+ public void testGetBuildingBlockStep() {\r
+ String result = _taskList.getBuildingBlockStep();\r
+ assertEquals(_buildingBlockStep, result);\r
+\r
+ }\r
+\r
+ @Test\r
+ public void testSetBuildingBlockStep() {\r
+ _taskList.setBuildingBlockStep(_buildingBlockStep);\r
+ verify(_taskList).setBuildingBlockStep(_buildingBlockStep);\r
+ }\r
+\r
+ @Test\r
+ public void testGetValidResponses() {\r
+\r
+ JSONArray result = _taskList.getValidResponses();\r
+ assertEquals(_validResponses, result);\r
+\r
+ }\r
+ \r
+ @Test\r
+ public void testSetValidResponses() {\r
+ _taskList.setValidResponses(_validResponses);\r
+ verify(_taskList).setValidResponses(_validResponses);\r
+ }\r
+\r
+\r
+}\r
--- /dev/null
+/*-\r
+ * ============LICENSE_START=======================================================\r
+ * ONAP - SO\r
+ * ================================================================================\r
+ * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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
+\r
+package org.openecomp.mso.apihandlerinfra.tasksbeans;\r
+\r
+import org.junit.After;\r
+\r
+import static org.junit.Assert.assertEquals;\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+\r
+import static org.mockito.Mockito.mock;\r
+import static org.mockito.Mockito.verify;\r
+import static org.mockito.Mockito.when;\r
+\r
+public class TaskRequestReferenceTest {\r
+\r
+ TaskRequestReference _taskRequestReference;\r
+\r
+ protected String _taskId;\r
+ public TaskRequestReferenceTest() {\r
+ }\r
+ \r
+ @Before\r
+ public void setUp() {\r
+ _taskRequestReference = mock(TaskRequestReference.class);\r
+ _taskId = "taskid";\r
+ \r
+ when(_taskRequestReference.getTaskId()).thenReturn(_taskId);\r
+ }\r
+\r
+ @After\r
+ public void tearDown() {\r
+ _taskRequestReference = null;\r
+ }\r
+\r
+ /**\r
+ * Test getTaskRequestReference \r
+ */\r
+ @Test\r
+ public void taskGetRequestReference() {\r
+ String result = _taskRequestReference.getTaskId();\r
+ assertEquals(_taskId, result);\r
+ }\r
+\r
+ /**\r
+ * Test setTaskRequestReference\r
+ */\r
+ @Test\r
+ public void testSetRequestInfo() {\r
+ _taskRequestReference.setTaskId(_taskId);\r
+ verify(_taskRequestReference).setTaskId(_taskId);\r
+ }\r
+}\r
--- /dev/null
+/*-\r
+ * ============LICENSE_START=======================================================\r
+ * ONAP - SO\r
+ * ================================================================================\r
+ * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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
+\r
+package org.openecomp.mso.apihandlerinfra.tasksbeans;\r
+\r
+import org.junit.After;\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+import static org.junit.Assert.*;\r
+import static org.mockito.Mockito.mock;\r
+import static org.mockito.Mockito.verify;\r
+import static org.mockito.Mockito.when;\r
+\r
+public class TaskVariableValueTest {\r
+ TaskVariableValue _taskVariableValue;\r
+ protected String _name;\r
+ protected String _value;\r
+ protected String _operator;\r
+\r
+ public TaskVariableValueTest() {\r
+ }\r
+\r
+ @Before\r
+ public void setUp() {\r
+ _taskVariableValue = mock(TaskVariableValue.class);\r
+ _name = "name";\r
+ _value = "value";\r
+ _operator = "operator";\r
+ when(_taskVariableValue.getName()).thenReturn(_name);\r
+ when(_taskVariableValue.getValue()).thenReturn(_value);\r
+ when(_taskVariableValue.getOperator()).thenReturn(_operator);\r
+ }\r
+\r
+ @After\r
+ public void tearDown() {\r
+ _taskVariableValue = null;\r
+ }\r
+\r
+ /**\r
+ * Test of getName method\r
+ */\r
+ @Test\r
+ public void testGetName() {\r
+ _taskVariableValue.setName(_name);\r
+ assertEquals(_taskVariableValue.getName(),_name);\r
+\r
+ }\r
+\r
+ /**\r
+ * Test setName\r
+ */\r
+ @Test\r
+ public void testSetName() {\r
+ _taskVariableValue.setName(_name);\r
+ verify(_taskVariableValue).setName(_name);\r
+ }\r
+ \r
+ /**\r
+ * Test of getName method\r
+ */\r
+ @Test\r
+ public void testGetValue() {\r
+ _taskVariableValue.setValue(_value);\r
+ assertEquals(_taskVariableValue.getValue(),_value);\r
+\r
+ }\r
+\r
+ /**\r
+ * Test setName\r
+ */\r
+ @Test\r
+ public void testSetValue() {\r
+ _taskVariableValue.setValue(_value);\r
+ verify(_taskVariableValue).setValue(_value);\r
+ }\r
+ \r
+ /**\r
+ * Test of getName method\r
+ */\r
+ @Test\r
+ public void testGetOperator() {\r
+ _taskVariableValue.setOperator(_operator);\r
+ assertEquals(_taskVariableValue.getOperator(),_operator);\r
+\r
+ }\r
+\r
+ /**\r
+ * Test setName\r
+ */\r
+ @Test\r
+ public void testSetRequestDetails() {\r
+ _taskVariableValue.setOperator(_operator);\r
+ verify(_taskVariableValue).setOperator(_operator);\r
+ }\r
+\r
+}\r
--- /dev/null
+/*-\r
+ * ============LICENSE_START=======================================================\r
+ * ONAP - SO\r
+ * ================================================================================\r
+ * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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
+\r
+package org.openecomp.mso.apihandlerinfra.tasksbeans;\r
+\r
+import org.junit.After;\r
+\r
+import static org.junit.Assert.assertEquals;\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+\r
+import static org.mockito.Mockito.mock;\r
+import static org.mockito.Mockito.verify;\r
+import static org.mockito.Mockito.when;\r
+\r
+import java.util.List;\r
+\r
+public class TaskVariablesTest {\r
+\r
+ TaskVariables _taskVariables;\r
+ private List<TaskVariableValue> _taskVariableValueList;\r
+\r
+ public TaskVariablesTest() {\r
+ }\r
+\r
+ @SuppressWarnings("unchecked")\r
+ @Before\r
+ public void setUp() {\r
+ _taskVariables = mock(TaskVariables.class);\r
+ _taskVariableValueList = mock(List.class);\r
+ when(_taskVariables.getTaskVariables()).thenReturn(_taskVariableValueList);\r
+ }\r
+\r
+ @After\r
+ public void tearDown() {\r
+ _taskVariables = null;\r
+ }\r
+\r
+ @Test\r
+ public void testGetTaskVariables() {\r
+ List<TaskVariableValue> result = _taskVariables.getTaskVariables();\r
+ assertEquals(_taskVariableValueList, result);\r
+\r
+ }\r
+\r
+ @Test\r
+ public void testSetTaskVariables() {\r
+ _taskVariables.setTaskVariables(_taskVariableValueList);\r
+ verify(_taskVariables).setTaskVariables(_taskVariableValueList);\r
+\r
+ }\r
+}\r
--- /dev/null
+/*-\r
+ * ============LICENSE_START=======================================================\r
+ * ONAP - SO\r
+ * ================================================================================\r
+ * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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
+\r
+package org.openecomp.mso.apihandlerinfra.tasksbeans;\r
+\r
+import org.junit.After;\r
+\r
+import static org.junit.Assert.assertEquals;\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+\r
+import static org.mockito.Mockito.mock;\r
+import static org.mockito.Mockito.verify;\r
+import static org.mockito.Mockito.when;\r
+\r
+import java.util.List;\r
+\r
+public class TasksGetResponseTest {\r
+\r
+ TasksGetResponse _tasksGetResponse;\r
+ private List<TaskList> _taskList;\r
+\r
+ public TasksGetResponseTest() {\r
+ }\r
+\r
+ @SuppressWarnings("unchecked")\r
+ @Before\r
+ public void setUp() {\r
+ _tasksGetResponse = mock(TasksGetResponse.class);\r
+ _taskList = mock(List.class);\r
+ when(_tasksGetResponse.getTaskList()).thenReturn(_taskList);\r
+ }\r
+\r
+ @After\r
+ public void tearDown() {\r
+ _tasksGetResponse = null;\r
+ }\r
+\r
+ @Test\r
+ public void testGetTaskList() {\r
+ List<TaskList> result = _tasksGetResponse.getTaskList();\r
+ assertEquals(_taskList, result);\r
+\r
+ }\r
+\r
+ @Test\r
+ public void testSetTaskList() {\r
+ _tasksGetResponse.setTaskList(_taskList);\r
+ verify(_tasksGetResponse).setTaskList(_taskList);\r
+\r
+ }\r
+}\r
--- /dev/null
+/*-\r
+ * ============LICENSE_START=======================================================\r
+ * ONAP - SO\r
+ * ================================================================================\r
+ * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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
+\r
+package org.openecomp.mso.apihandlerinfra.tasksbeans;\r
+\r
+import org.junit.After;\r
+import static org.junit.Assert.assertTrue;\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+import static org.mockito.Mockito.mock;\r
+import static org.mockito.Mockito.verify;\r
+import static org.mockito.Mockito.when;\r
+\r
+\r
+public class TasksRequestTest {\r
+ TasksRequest _tasksRequest;\r
+ private RequestDetails _requestDetails;\r
+\r
+ public TasksRequestTest() {\r
+ }\r
+\r
+ @Before\r
+ public void setUp() {\r
+ _tasksRequest = mock(TasksRequest.class);\r
+ _requestDetails = new RequestDetails();\r
+ when(_tasksRequest.getRequestDetails()).thenReturn(_requestDetails);\r
+ }\r
+\r
+ @After\r
+ public void tearDown() {\r
+ _tasksRequest = null;\r
+ }\r
+\r
+ /**\r
+ * Test of getRequestDetails method\r
+ */\r
+ @Test\r
+ public void testGetRequestDetails() {\r
+ _tasksRequest.setRequestDetails(_requestDetails);\r
+ assertTrue(_tasksRequest.getRequestDetails().equals(_requestDetails));\r
+\r
+ }\r
+\r
+ /**\r
+ * Test setRequestDetails\r
+ */\r
+ @Test\r
+ public void testSetRequestDetails() {\r
+ _tasksRequest.setRequestDetails(_requestDetails);\r
+ verify(_tasksRequest).setRequestDetails(_requestDetails);\r
+ }\r
+\r
+}\r
--- /dev/null
+/*-\r
+ * ============LICENSE_START=======================================================\r
+ * ONAP - SO\r
+ * ================================================================================\r
+ * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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
+\r
+package org.openecomp.mso.apihandlerinfra.tasksbeans;\r
+\r
+import org.junit.After;\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+import static org.junit.Assert.*;\r
+import static org.mockito.Mockito.mock;\r
+import static org.mockito.Mockito.verify;\r
+import static org.mockito.Mockito.when;\r
+\r
+public class ValueTest {\r
+ Value _valueInstance;\r
+ protected String _value;\r
+\r
+ public ValueTest() {\r
+ }\r
+\r
+ @Before\r
+ public void setUp() {\r
+ _valueInstance = mock(Value.class);\r
+ _value = "_value";\r
+ when(_valueInstance.getValue()).thenReturn(_value);\r
+ }\r
+\r
+ @After\r
+ public void tearDown() {\r
+ _valueInstance = null;\r
+ }\r
+\r
+ /**\r
+ * Test of getValue method\r
+ */\r
+ @Test\r
+ public void testGetValue() {\r
+ _valueInstance.setValue(_value);\r
+ assertEquals(_valueInstance.getValue(),_value);\r
+\r
+ }\r
+\r
+ /**\r
+ * Test setValue\r
+ */\r
+ @Test\r
+ public void testSetValue() {\r
+ _valueInstance.setValue(_value);\r
+ verify(_valueInstance).setValue(_value);\r
+ }\r
+}\r
--- /dev/null
+/*-\r
+ * ============LICENSE_START=======================================================\r
+ * ONAP - SO\r
+ * ================================================================================\r
+ * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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
+\r
+package org.openecomp.mso.apihandlerinfra.tasksbeans;\r
+\r
+import org.junit.After;\r
+import org.junit.Before;\r
+import org.junit.Test;\r
+import static org.junit.Assert.*;\r
+import static org.mockito.Mockito.mock;\r
+import static org.mockito.Mockito.verify;\r
+import static org.mockito.Mockito.when;\r
+\r
+public class VariablesTest {\r
+\r
+ Variables _variables;\r
+ protected Value _source;\r
+ protected Value _responseValue;\r
+ protected Value _requestorId;\r
+ \r
+ @Before\r
+ public void setUp() {\r
+ _variables = mock(Variables.class);\r
+ _source = mock(Value.class);\r
+ _responseValue = mock(Value.class);\r
+ _requestorId = mock(Value.class);\r
+ \r
+ when(_variables.getSource()).thenReturn(_source);\r
+ when(_variables.getRequestorId()).thenReturn(_requestorId);\r
+ when(_variables.getResponseValue()).thenReturn(_responseValue);\r
+ \r
+ }\r
+\r
+ @After\r
+ public void tearDown() {\r
+ _variables = null;\r
+ _source = null;\r
+ _responseValue = null;\r
+ _requestorId = null;\r
+ }\r
+ \r
+ @Test\r
+ public void testGetSource() {\r
+ _variables.setSource(_source);\r
+ assertTrue(_variables.getSource().equals(_source));\r
+ }\r
+\r
+ @Test\r
+ public void testSetSource(){\r
+ _variables.setSource(_source);\r
+ verify(_variables).setSource(_source);\r
+ } \r
+ \r
+ @Test\r
+ public void testGetResponseValue() {\r
+ _variables.setResponseValue(_responseValue);\r
+ assertTrue(_variables.getResponseValue().equals(_responseValue));\r
+ }\r
+\r
+ @Test\r
+ public void testSetResponseValue(){\r
+ _variables.setResponseValue(_responseValue);\r
+ verify(_variables).setResponseValue(_responseValue);\r
+ } \r
+ \r
+ @Test\r
+ public void testGetRequestorId() {\r
+ _variables.setRequestorId(_requestorId);\r
+ assertTrue(_variables.getRequestorId().equals(_requestorId));\r
+ }\r
+\r
+ @Test\r
+ public void testSetRequestorId(){\r
+ _variables.setRequestorId(_requestorId);\r
+ verify(_variables).setRequestorId(_requestorId);\r
+ } \r
+ \r
+}\r