Merge "Fix retrieval of resourceInputObj in delete e2e"
authorChuanyu Chen <chenchuanyu@huawei.com>
Tue, 27 Nov 2018 09:58:23 +0000 (09:58 +0000)
committerGerrit Code Review <gerrit@onap.org>
Tue, 27 Nov 2018 09:58:23 +0000 (09:58 +0000)
12 files changed:
adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapterImpl.java
adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/adapters/MSORequestDBImplTest.java
bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/CatalogDbUtils.groovy
bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ActivateSDNCNetworkResource.groovy
bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Create3rdONAPE2EServiceInstance.groovy
bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateDeviceResource.groovy
bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy
bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeActivateSDNCNetworkResource.groovy
bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Delete3rdONAPE2EServiceInstance.groovy
bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteDeviceResource.groovy
bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteSDNCNetworkResource.groovy
packages/docker/src/main/docker/docker-files/scripts/start-app.sh

index dc6abce..c8ea165 100644 (file)
@@ -201,7 +201,10 @@ public class MsoRequestsDbAdapterImpl implements MsoRequestsDbAdapter {
                        String error = "Entity not found. Unable to retrieve OperationStatus Object ServiceId: " + serviceId + " operationId: "
                                        + operationId;
                        logger.error(error);
-                       throw new MsoRequestsDbException(error,MsoLogger.ErrorCode.BusinessProcesssError);
+//                     throw new MsoRequestsDbException(error,MsoLogger.ErrorCode.BusinessProcesssError);
+                       operStatus = new OperationStatus();
+                       operStatus.setOperationId(operationId);
+                       operStatus.setServiceId(serviceId);
                }
 
                operStatus.setUserId(userId);
index 7c2dd12..103e216 100644 (file)
@@ -365,35 +365,10 @@ public class MSORequestDBImplTest {
                updatedOperationStatus.setReason(reason);
                updatedOperationStatus.setOperationContent(operationContent);
 
-               try {
-            dbAdapter.updateServiceOperationStatus(serviceId, operationId, operation,  userId,
-                     result, operationContent,  progress, reason);
-            fail("Expected MsoRequestsDbException to be thrown");   
-        } catch (Exception e) {
-            assertEquals("Entity not found. Unable to retrieve OperationStatus Object ServiceId: " + serviceId + " operationId: " + operationId,e.getMessage());
-            for(ILoggingEvent logEvent : TestAppender.events)
-                if(logEvent.getLoggerName().equals("org.onap.so.logging.cxf.interceptor.SOAPLoggingInInterceptor") &&
-                        logEvent.getMarker().getName().equals("ENTRY")
-                        ){
-                    Map<String,String> mdc = logEvent.getMDCPropertyMap();
-                    assertNotNull(mdc.get(ONAPLogConstants.MDCs.INSTANCE_UUID));
-                    assertNotNull(mdc.get(ONAPLogConstants.MDCs.REQUEST_ID));
-                    assertNotNull(mdc.get(ONAPLogConstants.MDCs.INVOCATION_ID));
-                    assertEquals("",mdc.get(ONAPLogConstants.MDCs.PARTNER_NAME));
-                    assertEquals("/services/RequestsDbAdapter",mdc.get(ONAPLogConstants.MDCs.SERVICE_NAME));
-                    assertEquals("INPROGRESS",mdc.get(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE));
-                }else if(logEvent.getLoggerName().equals("org.onap.so.logging.cxf.interceptor.SOAPLoggingOutInterceptor") &&
-                        logEvent.getMarker()!= null && logEvent.getMarker().getName().equals("EXIT")){
-                    Map<String,String> mdc = logEvent.getMDCPropertyMap();
-                    assertNotNull(mdc.get(ONAPLogConstants.MDCs.REQUEST_ID));
-                    assertNotNull(mdc.get(ONAPLogConstants.MDCs.INVOCATION_ID));
-                    assertEquals("500",mdc.get(ONAPLogConstants.MDCs.RESPONSE_CODE));
-                    assertEquals("",mdc.get(ONAPLogConstants.MDCs.PARTNER_NAME));
-                    assertEquals("/services/RequestsDbAdapter",mdc.get(ONAPLogConstants.MDCs.SERVICE_NAME));
-                    assertEquals("ERROR",mdc.get(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE));
-                }
-        }              
-               
+               dbAdapter.updateServiceOperationStatus(serviceId, operationId, operation,  userId,
+                    result, operationContent,  progress, reason);              
+               OperationStatus dbOpStatus = operationStatusRepository.findOneByServiceIdAndOperationId(serviceId,operationId);         
+               assertThat(dbOpStatus, sameBeanAs(updatedOperationStatus).ignoring("operateAt").ignoring("finishedAt"));                
        }
        
        @Test 
index d5183ff..f1eab66 100644 (file)
@@ -982,22 +982,7 @@ class CatalogDbUtils {
                                                vfModuleModelJson.put("modelInfo", vfModuleModelInfo)
                                                String vfModuleType = jsonUtils.getJsonValueForKey(vfModule, "type")
                                                vfModuleModelJson.put("vfModuleType", vfModuleType)
-                                               switch(catalogUtilsVersion) {
-                                                       case "v1":
-                                                       //TODO this does not work, isBase is not a integer.
-                                                               Integer isBase = jsonUtils.getJsonIntValueForKey(vfModule, "isBase")
-                                                               if (isBase.intValue() == 1) {
-                                                                       vfModuleModelJson.put("isBase", "true")
-                                                               }
-                                                               else {
-                                                                       vfModuleModelJson.put("isBase", "false")
-                                                               }
-                                                               break
-                                                       default:
-                                                               boolean isBase = jsonUtils.getJsonBooleanValueForKey(vfModule, "isBase")
-                                                               vfModuleModelJson.put("isBase", isBase)
-                                                               break
-                                               }
+                                               vfModuleModelJson.put("isBase", jsonUtils.getJsonBooleanValueForKey(vfModule, "isBase"))
                                                String vfModuleLabel = jsonUtils.getJsonValueForKey(vfModule, "label")
                                                vfModuleModelJson.put("vfModuleLabel", vfModuleLabel)
                                                Integer initialCount = jsonUtils.getJsonIntValueForKey(vfModule, "initialCount")
index c5505f5..b912b64 100644 (file)
@@ -147,7 +147,7 @@ public class ActivateSDNCNetworkResource extends AbstractServiceTaskProcessor {
 
         String body = """
                 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
-                        xmlns:ns="http://org.openecomp.mso/requestsdb">
+                        xmlns:ns="http://org.onap.so/requestsdb">
                         <soapenv:Header/>
                 <soapenv:Body>
                     <ns:updateResourceOperationStatus>
index afd67c3..2ae7686 100644 (file)
@@ -278,7 +278,7 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
 
                String body = """
                 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
-                        xmlns:ns="http://org.openecomp.mso/requestsdb">
+                        xmlns:ns="http://org.onap.so/requestsdb">
                         <soapenv:Header/>
                 <soapenv:Body>
                     <ns:updateResourceOperationStatus>
index ff9a119..489e77e 100644 (file)
@@ -173,7 +173,7 @@ public class CreateDeviceResource extends AbstractServiceTaskProcessor {
 
                String body = """
                 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
-                        xmlns:ns="http://org.openecomp.mso/requestsdb">
+                        xmlns:ns="http://org.onap.so/requestsdb">
                         <soapenv:Header/>
                 <soapenv:Body>
                     <ns:updateResourceOperationStatus>
index 94630d6..a505f3f 100644 (file)
@@ -471,7 +471,7 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor {
 
         String body = """
                 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
-                        xmlns:ns="http://org.openecomp.mso/requestsdb">
+                        xmlns:ns="http://org.onap.so/requestsdb">
                         <soapenv:Header/>
                 <soapenv:Body>
                     <ns:updateResourceOperationStatus>
@@ -504,7 +504,7 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor {
 
         String body = """
                 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
-                        xmlns:ns="http://org.openecomp.mso/requestsdb">
+                        xmlns:ns="http://org.onap.so/requestsdb">
                         <soapenv:Header/>
                 <soapenv:Body>
                     <ns:updateResourceOperationStatus>
index 8f77728..66479be 100644 (file)
@@ -352,7 +352,7 @@ public class DeActivateSDNCNetworkResource extends AbstractServiceTaskProcessor
 
         String body = """
                 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
-                        xmlns:ns="http://org.openecomp.mso/requestsdb">
+                        xmlns:ns="http://org.onap.so/requestsdb">
                         <soapenv:Header/>
                 <soapenv:Body>
                     <ns:updateResourceOperationStatus>
index 052b28d..078d68b 100644 (file)
@@ -184,7 +184,7 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
 
                String body = """
                 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
-                        xmlns:ns="http://org.openecomp.mso/requestsdb">
+                        xmlns:ns="http://org.onap.so/requestsdb">
                         <soapenv:Header/>
                 <soapenv:Body>
                     <ns:updateResourceOperationStatus>
index 2829797..05e0f23 100644 (file)
@@ -167,7 +167,7 @@ public class DeleteDeviceResource extends AbstractServiceTaskProcessor {
 
                String body = """
                 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
-                        xmlns:ns="http://org.openecomp.mso/requestsdb">
+                        xmlns:ns="http://org.onap.so/requestsdb">
                         <soapenv:Header/>
                 <soapenv:Body>
                     <ns:updateResourceOperationStatus>
index 703a393..cf78193 100644 (file)
@@ -384,7 +384,7 @@ public class DeleteSDNCNetworkResource extends AbstractServiceTaskProcessor {
 
         String body = """
                 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
-                        xmlns:ns="http://org.openecomp.mso/requestsdb">
+                        xmlns:ns="http://org.onap.so/requestsdb">
                         <soapenv:Header/>
                 <soapenv:Body>
                     <ns:updateResourceOperationStatus>
@@ -417,7 +417,7 @@ public class DeleteSDNCNetworkResource extends AbstractServiceTaskProcessor {
 
         String body = """
                 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
-                        xmlns:ns="http://org.openecomp.mso/requestsdb">
+                        xmlns:ns="http://org.onap.so/requestsdb">
                         <soapenv:Header/>
                 <soapenv:Body>
                     <ns:updateResourceOperationStatus>
index 143b1cf..cb5586d 100644 (file)
@@ -77,7 +77,7 @@ if [ ! -z "${TRUSTSTORE}" ]; then
        jksargs="$jksargs -Djavax.net.ssl.trustStorePassword=${TRUSTSTORE_PASSWORD}"
 fi
 
-jvmargs="${JVM_ARGS} -Djava.security.egd=file:/dev/./urandom -Dlogs_dir=${LOG_PATH} -Dlogging.config=/app/logback-spring.xml $jksargs -Dspring.config.location=$CONFIG_PATH ${SSL_DEBUG} ${DISABLE_SNI}"
+jvmargs="${JVM_ARGS} -Djava.security.egd=file:/dev/./urandom -Dlogs_dir=${LOG_PATH} -Dlogging.config=/app/logback-spring.xml $jksargs -Dspring.config.additional-location=$CONFIG_PATH ${SSL_DEBUG} ${DISABLE_SNI}"
 
 echo "JVM Arguments: ${jvmargs}"