Merge "update INFO.yaml" into dublin
authorMarcus Williams <marcus.williams@intel.com>
Thu, 30 May 2019 15:23:17 +0000 (15:23 +0000)
committerGerrit Code Review <gerrit@onap.org>
Thu, 30 May 2019 15:23:17 +0000 (15:23 +0000)
adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProviderConfiguration.java
adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/VnfmAdapterControllerTest.java
bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmCreateJobTask.java
bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmDeleteJobTask.java
bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImpl.java
bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImplTest.java

index 164f12e..2aee1c0 100644 (file)
 
 package org.onap.so.adapters.vnfmadapter.extclients.vnfm;
 
+import static org.onap.so.client.RestTemplateConfig.CONFIGURABLE_REST_TEMPLATE;
+import com.google.gson.Gson;
+import java.util.Iterator;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.JSON;
 import org.onap.so.configuration.rest.BasicHttpHeadersProvider;
 import org.onap.so.configuration.rest.HttpHeadersProvider;
 import org.onap.so.rest.service.HttpRestServiceProvider;
@@ -32,8 +36,6 @@ import org.springframework.http.converter.HttpMessageConverter;
 import org.springframework.http.converter.json.GsonHttpMessageConverter;
 import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
 import org.springframework.web.client.RestTemplate;
-import java.util.Iterator;
-import static org.onap.so.client.RestTemplateConfig.CONFIGURABLE_REST_TEMPLATE;
 
 /**
  * Configures the HttpRestServiceProvider for REST call to a VNFM.
@@ -60,7 +62,8 @@ public class VnfmServiceProviderConfiguration {
                 iterator.remove();
             }
         }
-        restTemplate.getMessageConverters().add(new GsonHttpMessageConverter());
+        final Gson gson = new JSON().getGson();
+        restTemplate.getMessageConverters().add(new GsonHttpMessageConverter(gson));
     }
 
 }
index 73a49e9..b48de30 100644 (file)
@@ -52,6 +52,7 @@ import org.onap.aai.domain.yang.RelationshipData;
 import org.onap.aai.domain.yang.RelationshipList;
 import org.onap.so.adapters.vnfmadapter.VnfmAdapterApplication;
 import org.onap.so.adapters.vnfmadapter.extclients.SdcPackageProvider;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.JSON;
 import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse200;
 import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse2001;
 import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201;
@@ -115,7 +116,7 @@ public class VnfmAdapterControllerTest {
 
     @Autowired
     VnfmAdapterController controller;
-    Gson gson = new Gson();
+    Gson gson = new JSON().getGson();
 
     @Before
     public void setUp() throws Exception {
index 4645680..4c84bca 100644 (file)
@@ -55,11 +55,18 @@ public class MonitorVnfmCreateJobTask extends MonitorVnfmJobTask {
      * @param execution {@link org.onap.so.bpmn.common.DelegateExecutionImpl}
      */
     public void getCurrentOperationStatus(final BuildingBlockExecution execution) {
-        LOGGER.debug("Executing getCurrentOperationStatus  ...");
-        final CreateVnfResponse vnfInstantiateResponse = execution.getVariable(CREATE_VNF_RESPONSE_PARAM_NAME);
-        execution.setVariable(OPERATION_STATUS_PARAM_NAME,
-                getOperationStatus(execution, vnfInstantiateResponse.getJobId()));
-        LOGGER.debug("Finished executing getCurrentOperationStatus ...");
+        try {
+            LOGGER.debug("Executing getCurrentOperationStatus  ...");
+            final CreateVnfResponse vnfInstantiateResponse = execution.getVariable(CREATE_VNF_RESPONSE_PARAM_NAME);
+            execution.setVariable(OPERATION_STATUS_PARAM_NAME,
+                    getOperationStatus(execution, vnfInstantiateResponse.getJobId()));
+            LOGGER.debug("Finished executing getCurrentOperationStatus ...");
+        } catch (final Exception exception) {
+            final String message = "Unable to invoke get current Operation status";
+            LOGGER.error(message);
+            exceptionUtil.buildAndThrowWorkflowException(execution, 1209, message);
+
+        }
     }
 
     /**
index e91f362..34e3efa 100644 (file)
@@ -56,10 +56,18 @@ public class MonitorVnfmDeleteJobTask extends MonitorVnfmJobTask {
      * @param execution {@link org.onap.so.bpmn.common.DelegateExecutionImpl}
      */
     public void getCurrentOperationStatus(final BuildingBlockExecution execution) {
-        LOGGER.debug("Executing getCurrentOperationStatus  ...");
-        final DeleteVnfResponse deleteVnfResponse = execution.getVariable(Constants.DELETE_VNF_RESPONSE_PARAM_NAME);
-        execution.setVariable(OPERATION_STATUS_PARAM_NAME, getOperationStatus(execution, deleteVnfResponse.getJobId()));
-        LOGGER.debug("Finished executing getCurrentOperationStatus ...");
+        try {
+            LOGGER.debug("Executing getCurrentOperationStatus  ...");
+            final DeleteVnfResponse deleteVnfResponse = execution.getVariable(Constants.DELETE_VNF_RESPONSE_PARAM_NAME);
+            execution.setVariable(OPERATION_STATUS_PARAM_NAME,
+                    getOperationStatus(execution, deleteVnfResponse.getJobId()));
+            LOGGER.debug("Finished executing getCurrentOperationStatus ...");
+        } catch (final Exception exception) {
+            final String message = "Unable to invoke get current Operation status";
+            LOGGER.error(message);
+            exceptionUtil.buildAndThrowWorkflowException(execution, 1216, message);
+
+        }
     }
 
     /**
index f193967..4a51891 100644 (file)
@@ -145,7 +145,7 @@ public class VnfmAdapterServiceProviderImpl implements VnfmAdapterServiceProvide
             return Optional.of(response.getBody());
         } catch (final RestProcessingException | InvalidRestRequestException httpInvocationException) {
             LOGGER.error("Unexpected error while processing job request", httpInvocationException);
-            return Optional.absent();
+            throw httpInvocationException;
         }
     }
 }
index 7bd6435..e94d7c2 100644 (file)
@@ -228,7 +228,7 @@ public class VnfmAdapterServiceProviderImplTest {
         assertFalse(actual.isPresent());
     }
 
-    @Test
+    @Test(expected = RestProcessingException.class)
     public void testGetInstantiateOperationJobStatus_Exception() {
 
         when(mockedHttpServiceProvider.getHttpResponse(eq(TestConstants.JOB_STATUS_EXPECTED_URL),
@@ -237,8 +237,7 @@ public class VnfmAdapterServiceProviderImplTest {
         final VnfmAdapterServiceProvider objUnderTest =
                 new VnfmAdapterServiceProviderImpl(getVnfmAdapterUrlProvider(), mockedHttpServiceProvider);
 
-        final Optional<QueryJobResponse> actual = objUnderTest.getInstantiateOperationJobStatus(DUMMY_JOB_ID);
-        assertFalse(actual.isPresent());
+        objUnderTest.getInstantiateOperationJobStatus(DUMMY_JOB_ID);
     }
 
     private QueryJobResponse getQueryJobResponse() {