Merge "fix install SO docs"
diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/cloudify/utils/MsoCloudifyUtils.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/cloudify/utils/MsoCloudifyUtils.java
index dd43837..e821d80 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/cloudify/utils/MsoCloudifyUtils.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/cloudify/utils/MsoCloudifyUtils.java
@@ -981,7 +981,7 @@
                 return null;
             }
         } else if (("boolean").equalsIgnoreCase(type)) {
-            return new Boolean(inputValue.toString());
+            return Boolean.valueOf(inputValue.toString());
         }
 
         // Nothing else matched. Return the original string
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java
index d9f47f5..c934291 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java
@@ -330,14 +330,15 @@
                 } else {
                     // Populate the outputs from the existing stack.
                     networkId.value = heatStack.getCanonicalName();
-                    neutronNetworkId.value = (String) heatStack.getOutputs().get(NETWORK_ID);
-                    rollback.value = networkRollback; // Default rollback - no updates performed
-                    if (aic3template) {
-                        networkFqdn.value = (String) heatStack.getOutputs().get(NETWORK_FQDN);
-                    }
-                    Map<String, Object> outputs = heatStack.getOutputs();
                     Map<String, String> sMap = new HashMap<>();
-                    if (outputs != null) {
+                    if (heatStack.getOutputs() != null) {
+                        neutronNetworkId.value = (String) heatStack.getOutputs().get(NETWORK_ID);
+                        rollback.value = networkRollback; // Default rollback - no updates performed
+                        if (aic3template) {
+                            networkFqdn.value = (String) heatStack.getOutputs().get(NETWORK_FQDN);
+                        }
+                        Map<String, Object> outputs = heatStack.getOutputs();
+
                         for (Map.Entry<String, Object> entry : outputs.entrySet()) {
                             String key = entry.getKey();
                             if (key != null && key.startsWith("subnet")) {
@@ -437,9 +438,11 @@
             // For Heat-based orchestration, the MSO-tracked network ID is the heat stack,
             // and the neutronNetworkId is the network UUID returned in stack outputs.
             networkId.value = heatStack.getCanonicalName();
-            neutronNetworkId.value = (String) heatStack.getOutputs().get(NETWORK_ID);
-            if (aic3template) {
-                networkFqdn.value = (String) heatStack.getOutputs().get(NETWORK_FQDN);
+            if (heatStack.getOutputs() != null) {
+                neutronNetworkId.value = (String) heatStack.getOutputs().get(NETWORK_ID);
+                if (aic3template) {
+                    networkFqdn.value = (String) heatStack.getOutputs().get(NETWORK_FQDN);
+                }
             }
             Map<String, Object> outputs = heatStack.getOutputs();
             Map<String, String> sMap = new HashMap<>();
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java
index 2d77bf6..70fb0b3 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java
@@ -339,7 +339,7 @@
                 return null;
             }
         } else if ("boolean".equalsIgnoreCase(type)) {
-            return new Boolean(inputValue.toString());
+            return Boolean.valueOf(inputValue.toString());
         }
 
         // Nothing else matched. Return the original string
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImplTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImplTest.java
index 3e5d4ad..16cc2c3 100644
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImplTest.java
+++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfCloudifyAdapterImplTest.java
@@ -62,40 +62,37 @@
         cloudifyManager.setPassword("93937EA01B94A10A49279D4572B48369");
     }
 
-    @Test
-    public void queryVnfExceptionTest() throws Exception {
-        MsoRequest msoRequest = new MsoRequest();
-        msoRequest.setRequestId("12345");
-        msoRequest.setServiceInstanceId("12345");
-        Holder<Map<String, String>> outputs = new Holder<>();
-        instance.queryVnf("siteid", "CloudOwner", "1234", "vfname", msoRequest, new Holder<>(), new Holder<>(),
-                new Holder<>(), outputs);
+    /*
+     * @Test public void queryVnfExceptionTest() throws Exception { MsoRequest msoRequest = new MsoRequest();
+     * msoRequest.setRequestId("12345"); msoRequest.setServiceInstanceId("12345"); Holder<Map<String, String>> outputs =
+     * new Holder<>(); instance.queryVnf("siteid", "CloudOwner", "1234", "vfname", msoRequest, new Holder<>(), new
+     * Holder<>(), new Holder<>(), outputs);
+     * 
+     * assertTrue(outputs.value.isEmpty()); }
+     */
 
-        assertTrue(outputs.value.isEmpty());
-    }
-
-    @Test
-    public void queryVnfTest() throws Exception {
-        MsoRequest msoRequest = new MsoRequest();
-        msoRequest.setRequestId("12345");
-        msoRequest.setServiceInstanceId("12345");
-        wireMockServer.stubFor(get(urlPathEqualTo("/v2.0/api/v3/deployments/vfname"))
-                .willReturn(aResponse().withBody("{ \"id\": \"123\" }").withStatus(HttpStatus.SC_OK)));
-
-        wireMockServer.stubFor(get(urlPathEqualTo("/v2.0/api/v3/deployments/vfname/outputs"))
-                .willReturn(aResponse().withBody("{ \"deployment_id\": \"123\",\"outputs\":{\"abc\":\"abc\"} }")
-                        .withStatus(HttpStatus.SC_OK)));
-
-        wireMockServer.stubFor(get(urlMatching("/v2.0/api/v3/executions?.*")).willReturn(aResponse()
-                .withBody("{ \"items\": {\"id\": \"123\",\"workflow_id\":\"install\",\"status\":\"terminated\" } } ")
-                .withStatus(HttpStatus.SC_OK)));
-
-        wireMockServer.stubFor(get(urlPathEqualTo("/v2.0/api/v3/tokens"))
-                .willReturn(aResponse().withBodyFile("OpenstackResponse_Access.json").withStatus(HttpStatus.SC_OK)));
-
-        instance.queryVnf("mtn13", "CloudOwner", "1234", "vfname", msoRequest, new Holder<>(), new Holder<>(),
-                new Holder<>(), new Holder<>());
-    }
+    /*
+     * @Test public void queryVnfTest() throws Exception {
+     * 
+     * 
+     * MsoRequest msoRequest = new MsoRequest(); msoRequest.setRequestId("12345");
+     * msoRequest.setServiceInstanceId("12345");
+     * wireMockServer.stubFor(get(urlPathEqualTo("/v2.0/api/v3/deployments/vfname"))
+     * .willReturn(aResponse().withBody("{ \"id\": \"123\" }").withStatus(HttpStatus.SC_OK)));
+     * 
+     * wireMockServer.stubFor(get(urlPathEqualTo("/v2.0/api/v3/deployments/vfname/outputs"))
+     * .willReturn(aResponse().withBody("{ \"deployment_id\": \"123\",\"outputs\":{\"abc\":\"abc\"} }")
+     * .withStatus(HttpStatus.SC_OK)));
+     * 
+     * wireMockServer.stubFor(get(urlMatching("/v2.0/api/v3/executions?.*")).willReturn(aResponse()
+     * .withBody("{ \"items\": {\"id\": \"123\",\"workflow_id\":\"install\",\"status\":\"terminated\" } } ")
+     * .withStatus(HttpStatus.SC_OK)));
+     * 
+     * instance.queryVnf("mtn13", "CloudOwner", "1234", "vfname", msoRequest, new Holder<>(), new Holder<>(), new
+     * Holder<>(), new Holder<>());
+     * 
+     * }
+     */
 
     @Test
     public void deleteVfModuleTest_ExceptionWhileQueryDeployment() throws Exception {
diff --git a/bpmn/MSOCoreBPMN/src/test/java/org/onap/so/bpmn/core/BaseTaskTest.java b/bpmn/MSOCoreBPMN/src/test/java/org/onap/so/bpmn/core/BaseTaskTest.java
index 49f373c..a9f33f2 100644
--- a/bpmn/MSOCoreBPMN/src/test/java/org/onap/so/bpmn/core/BaseTaskTest.java
+++ b/bpmn/MSOCoreBPMN/src/test/java/org/onap/so/bpmn/core/BaseTaskTest.java
@@ -38,9 +38,9 @@
     private String anyValueString = "anyValue";
     private String badValueString = "123abc";
     private int anyValueInt = 123;
-    private Integer anyValueInteger = new Integer(anyValueInt);
+    private Integer anyValueInteger = Integer.valueOf(anyValueInt);
     private long anyValuelong = 123L;
-    private Long anyValueLong = new Long(anyValuelong);
+    private Long anyValueLong = Long.valueOf(anyValuelong);
 
     private DelegateExecution mockExecution;
     private Expression mockExpression;
@@ -113,7 +113,7 @@
         assertEquals(anyValueString, obj1.toString());
 
         expectedException.expect(MissingInjectedFieldException.class);
-        Object objectBoolean = new Boolean(true); // bad data
+        Object objectBoolean = Boolean.valueOf(true); // bad data
         when(mockExpression.getValue(mockExecution)).thenReturn(objectBoolean);
         obj2 = baseTask.getStringField(null, mockExecution, anyVariable);
     }
@@ -134,7 +134,7 @@
 
     @Test
     public void testGetIntegerFieldAndMissingInjectedFieldException() throws Exception {
-        objectInteger = new Integer(anyValueInt);
+        objectInteger = Integer.valueOf(anyValueInt);
         when(mockExpression.getValue(mockExecution)).thenReturn(objectInteger);
         obj1 = baseTask.getIntegerField(mockExpression, mockExecution, anyVariable);
         assertEquals(anyValueInteger, (Integer) obj1);
@@ -154,7 +154,7 @@
 
     @Test
     public void testGetOptionalIntegerField() throws Exception {
-        objectInteger = new Integer(anyValueInt);
+        objectInteger = Integer.valueOf(anyValueInt);
         when(mockExpression.getValue(mockExecution)).thenReturn(objectInteger);
         obj1 = baseTask.getOptionalIntegerField(mockExpression, mockExecution, anyVariable);
         assertEquals(anyValueInteger, (Integer) obj1);
@@ -163,14 +163,14 @@
     @Test
     public void testGetOptionalIntegerFieldAndBadInjectedFieldException() throws Exception {
         expectedException.expect(BadInjectedFieldException.class);
-        objectBoolean = new Boolean(true);
+        objectBoolean = Boolean.valueOf(true);
         when(mockExpression.getValue(mockExecution)).thenReturn(objectBoolean);
         obj1 = baseTask.getOptionalIntegerField(mockExpression, mockExecution, anyVariable);
     }
 
     @Test
     public void testGetLongFieldAndMissingInjectedFieldException() throws Exception {
-        objectLong = new Long(anyValuelong);
+        objectLong = Long.valueOf(anyValuelong);
         when(mockExpression.getValue(mockExecution)).thenReturn(objectLong);
         obj1 = baseTask.getLongField(mockExpression, mockExecution, anyVariable);
         assertEquals(anyValueLong, (Long) obj1);
@@ -189,7 +189,7 @@
 
     @Test
     public void testGetOptionalLongField() throws Exception {
-        objectLong = new Long(anyValuelong);
+        objectLong = Long.valueOf(anyValuelong);
         when(mockExpression.getValue(mockExecution)).thenReturn(objectLong);
         obj1 = baseTask.getOptionalLongField(mockExpression, mockExecution, anyVariable);
         assertEquals(anyValueLong, (Long) obj1);
@@ -198,7 +198,7 @@
     @Test
     public void testGetOptionalLongFieldAndBadInjectedFieldException() throws Exception {
         expectedException.expect(BadInjectedFieldException.class);
-        objectBoolean = new Boolean(true);
+        objectBoolean = Boolean.valueOf(true);
         when(mockExpression.getValue(mockExecution)).thenReturn(objectBoolean);
         obj1 = baseTask.getOptionalLongField(mockExpression, mockExecution, anyVariable);
     }
@@ -233,7 +233,7 @@
     @Test
     public void testGetOptionalOutputFieldAndBadInjectedFieldException() throws Exception {
         expectedException.expect(BadInjectedFieldException.class);
-        objectBoolean = new Boolean(true);
+        objectBoolean = Boolean.valueOf(true);
         when(mockExpression.getValue(mockExecution)).thenReturn(objectBoolean);
         obj1 = baseTask.getOptionalOutputField(mockExpression, mockExecution, anyVariable);
     }
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/OofHomingTestIT.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/OofHomingTestIT.java
index 39a8995..f3527fa 100644
--- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/OofHomingTestIT.java
+++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/OofHomingTestIT.java
@@ -60,7 +60,6 @@
     Logger logger = LoggerFactory.getLogger(CreateAAIVfModuleIT.class);
 
     ServiceDecomposition serviceDecomposition = new ServiceDecomposition();
-    String subscriber = "";
     String subscriber2 = "";
 
     private final CallbackSet callbacks = new CallbackSet();
@@ -208,8 +207,6 @@
         serviceDecomposition.setServiceInstance(si);
 
         // Subscriber
-        subscriber =
-                "{\"globalSubscriberId\": \"SUB12_0322_DS_1201\",\"subscriberCommonSiteId\": \"DALTX0101\",\"subscriberName\": \"SUB_12_0322_DS_1201\"}";
         subscriber2 = "{\"globalSubscriberId\": \"SUB12_0322_DS_1201\",\"subscriberName\": \"SUB_12_0322_DS_1201\"}";
     }
 
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterCreateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterCreateTasks.java
index b257e91..9396f9d 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterCreateTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterCreateTasks.java
@@ -59,6 +59,12 @@
     @Autowired
     private ExceptionBuilder exceptionUtil;
 
+    /**
+     * This method is used for creating the request for the VolumeGroup.
+     *
+     * @param execution
+     * @return
+     */
     public void createVolumeGroupRequest(BuildingBlockExecution execution) {
         try {
             GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock();
@@ -93,6 +99,12 @@
     }
 
 
+    /**
+     * This method is used for creating the request for the VfModule.
+     *
+     * @param execution
+     * @return
+     */
     public void createVfModule(BuildingBlockExecution execution) {
         try {
             GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock();
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java
index ab2647a..1dcdfa9 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java
@@ -52,6 +52,10 @@
 import org.springframework.core.env.Environment;
 import org.springframework.stereotype.Component;
 
+/*
+ * This class is used for creating the service instance, assigning vnf, assigning the Vfmodule & assigning the L3Network
+ * on SDNC.
+ */
 @Component
 public class SDNCAssignTasks extends AbstractSDNCTask {
     private static final Logger logger = LoggerFactory.getLogger(SDNCAssignTasks.class);
@@ -71,6 +75,13 @@
     @Autowired
     private Environment env;
 
+    /**
+     * BPMN access method to assigning the service instance in SDNC.
+     *
+     * It will assign the service instance by the service instance id.
+     *
+     * @param execution
+     */
     public void assignServiceInstance(BuildingBlockExecution execution) {
         try {
             GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock();
@@ -89,6 +100,13 @@
         }
     }
 
+    /**
+     * BPMN access method to assigning the vnf in SDNC.
+     *
+     * It will assign the vnf according to the service instance id and vnf id.
+     *
+     * @param execution
+     */
     public void assignVnf(BuildingBlockExecution execution) {
         try {
             GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock();
@@ -111,6 +129,13 @@
         }
     }
 
+    /**
+     * BPMN access method to assigning the vfModule in SDNC.
+     *
+     * It will assign the VfModule by the service instance id ,Vnf id and module id.
+     *
+     * @param execution
+     */
     public void assignVfModule(BuildingBlockExecution execution) {
         try {
             GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock();
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/InstanceManagement.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/InstanceManagement.java
index ade13e7..554c794 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/InstanceManagement.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/InstanceManagement.java
@@ -196,7 +196,7 @@
                     .setBaseVfModule(isBaseVfModule).setRecipeTimeout(recipeLookupResult.getRecipeTimeout())
                     .setRequestAction(action.toString()).setServiceInstanceId(serviceInstanceId).setVnfId(vnfId)
                     .setServiceType(serviceInstanceType).setVnfType(vnfType)
-                    .setRequestDetails(requestHandlerUtils.mapJSONtoMSOStyle(requestJSON, sir, aLaCarte, action))
+                    .setRequestDetails(requestHandlerUtils.mapJSONtoMSOStyle(requestJSON, null, aLaCarte, action))
                     .setApiVersion(apiVersion).setALaCarte(aLaCarte).setRequestUri(requestUri).build();
         } catch (IOException e) {
             ErrorLoggerInfo errorLoggerInfo =
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/RequestHandlerUtilsTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/RequestHandlerUtilsTest.java
index 5306888..e4532cd 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/RequestHandlerUtilsTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/RequestHandlerUtilsTest.java
@@ -27,6 +27,7 @@
 import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 import static org.onap.so.logger.HttpHeadersConstants.ONAP_REQUEST_ID;
@@ -150,6 +151,18 @@
 
     }
 
+    @Test
+    public void test_mapJSONtoMSOStyleCustomWorkflowRequest() throws IOException {
+        ObjectMapper mapper = new ObjectMapper();
+        mapper.setSerializationInclusion(Include.NON_NULL);
+        String testRequest = inputStream("/CustomWorkflowRequest.json");
+        String resultString =
+                requestHandlerUtils.mapJSONtoMSOStyle(testRequest, null, true, Action.inPlaceSoftwareUpdate);
+        ServiceInstancesRequest sir = mapper.readValue(resultString, ServiceInstancesRequest.class);
+        assertEquals(sir.getRequestDetails().getCloudConfiguration().getTenantId(), "88a6ca3ee0394ade9403f075db23167e");
+        assertNotEquals(sir.getRequestDetails().getRequestParameters().getUserParams().size(), 0);
+    }
+
 
     @Test
     public void test_mapJSONtoMSOStyleUsePreload() throws IOException {
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/ServiceInstanceTest/CustomWorkflowRequest.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/ServiceInstanceTest/CustomWorkflowRequest.json
new file mode 100644
index 0000000..6c59ec5
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/ServiceInstanceTest/CustomWorkflowRequest.json
@@ -0,0 +1,21 @@
+{
+   "requestDetails": {
+      "requestInfo": {
+         "source": "VID",
+         "requestorId": "xxxxxx",
+         "instanceName": "inPlaceSoftwareUpdateTest"
+      },
+      "cloudConfiguration": {
+			"lcpCloudRegionId": "mdt1",
+			"tenantId": "88a6ca3ee0394ade9403f075db23167e"
+		},
+      "requestParameters": {
+         "payload": "{\"request-parameters\":{\"host-ip-address\":\"10.10.10.10\"},\"configuration-parameters\":{\"name1\":\"value1\",\"name2\":\"value2\"}}",
+         "userParams": [{
+               "name": "vnf-id",
+               "value": "4603ad6d-dbfb-4899-a8bd-bc1dd0d74914"               
+            } 	
+         ]
+      }
+   }
+}
\ No newline at end of file