Merge "allow RestClient to configure custom headers"
diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V8.9__EnforceNotNullWithDefaults.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V8.9__EnforceNotNullWithDefaults.sql
new file mode 100644
index 0000000..068ffc4
--- /dev/null
+++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V8.9__EnforceNotNullWithDefaults.sql
@@ -0,0 +1,25 @@
+use catalogdb;
+
+UPDATE network_resource SET ORCHESTRATION_MODE = 'HEAT' WHERE ORCHESTRATION_MODE IS NULL;
+UPDATE vf_module_customization SET INITIAL_COUNT = '0' WHERE INITIAL_COUNT IS NULL;
+UPDATE vf_module_customization SET MIN_INSTANCES = '0' WHERE MIN_INSTANCES IS NULL;
+UPDATE workflow SET ARTIFACT_CHECKSUM = 'RECORD' WHERE ARTIFACT_CHECKSUM IS NULL;
+UPDATE identity_services SET ADMIN_PROJECT_DOMAIN_NAME = 'Default' WHERE ADMIN_PROJECT_DOMAIN_NAME IS NULL;
+UPDATE vnf_resource_customization SET SKIP_POST_INSTANTIATION_CONFIGURATION = true WHERE SKIP_POST_INSTANTIATION_CONFIGURATION IS NULL;
+UPDATE pnf_resource_customization SET SKIP_POST_INSTANTIATION_CONFIGURATION = true WHERE SKIP_POST_INSTANTIATION_CONFIGURATION IS NULL;
+UPDATE vnf_resource_customization SET NF_DATA_VALID = 0 WHERE NF_DATA_VALID IS NULL;
+UPDATE cloud_sites SET SUPPORT_FABRIC = 1 WHERE SUPPORT_FABRIC IS NULL;
+UPDATE service SET SKIP_POST_INSTANTIATION_CONFIGURATION = true WHERE SKIP_POST_INSTANTIATION_CONFIGURATION IS NULL;
+UPDATE vf_module_customization SET SKIP_POST_INSTANTIATION_CONFIGURATION = true WHERE SKIP_POST_INSTANTIATION_CONFIGURATION IS NULL;
+
+ALTER TABLE network_resource MODIFY ORCHESTRATION_MODE varchar(20) NOT NULL DEFAULT 'HEAT';
+ALTER TABLE vf_module_customization MODIFY INITIAL_COUNT int(11) NOT NULL DEFAULT '0';
+ALTER TABLE vf_module_customization MODIFY MIN_INSTANCES int(11) NOT NULL DEFAULT '0';
+ALTER TABLE workflow MODIFY ARTIFACT_CHECKSUM VARCHAR(200) NOT NULL DEFAULT 'MANUAL RECORD';
+ALTER TABLE identity_services MODIFY ADMIN_PROJECT_DOMAIN_NAME varchar(255) NOT NULL DEFAULT 'Default';
+ALTER TABLE vnf_resource_customization MODIFY SKIP_POST_INSTANTIATION_CONFIGURATION boolean NOT NULL DEFAULT true;
+ALTER TABLE pnf_resource_customization MODIFY SKIP_POST_INSTANTIATION_CONFIGURATION boolean NOT NULL DEFAULT true;
+ALTER TABLE vnf_resource_customization MODIFY NF_DATA_VALID tinyint(1) NOT NULL DEFAULT 0;
+ALTER TABLE cloud_sites MODIFY SUPPORT_FABRIC bit(1) NOT NULL DEFAULT 1;
+ALTER TABLE service MODIFY SKIP_POST_INSTANTIATION_CONFIGURATION boolean NOT NULL DEFAULT true;
+ALTER TABLE vf_module_customization MODIFY SKIP_POST_INSTANTIATION_CONFIGURATION boolean NOT NULL DEFAULT true;
\ No newline at end of file
diff --git a/adapters/mso-catalog-db-adapter/src/test/resources/ExpectedService.json b/adapters/mso-catalog-db-adapter/src/test/resources/ExpectedService.json
index 2dc83c8..c99b185 100644
--- a/adapters/mso-catalog-db-adapter/src/test/resources/ExpectedService.json
+++ b/adapters/mso-catalog-db-adapter/src/test/resources/ExpectedService.json
@@ -31,6 +31,7 @@
       "cloudVersionMax": "cloudVersionMax",
       "category": "category",
       "subCategory": "subCategory",
+      "nfDataValid": false,
       "vfModule": [
         {
           "modelVersionId": "modelUUID",
diff --git a/adapters/mso-openstack-adapters/src/test/resources/schema.sql b/adapters/mso-openstack-adapters/src/test/resources/schema.sql
index 3357fec..44fbbd9 100644
--- a/adapters/mso-openstack-adapters/src/test/resources/schema.sql
+++ b/adapters/mso-openstack-adapters/src/test/resources/schema.sql
@@ -648,7 +648,7 @@
   `TOSCA_NODE_TYPE` varchar(200) DEFAULT NULL,
   `AIC_VERSION_MIN` varchar(20) NULL,
   `AIC_VERSION_MAX` varchar(20) DEFAULT NULL,
-  `ORCHESTRATION_MODE` varchar(20) DEFAULT 'HEAT',
+  `ORCHESTRATION_MODE` varchar(20) NOT NULL DEFAULT 'HEAT',
   `CREATION_TIMESTAMP` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
   `RESOURCE_CATEGORY` varchar(200) DEFAULT NULL,
   `RESOURCE_SUB_CATEGORY` varchar(200) DEFAULT NULL,
@@ -958,8 +958,8 @@
   `ID` int(13) NOT NULL AUTO_INCREMENT,
   `MODEL_CUSTOMIZATION_UUID` varchar(200) NOT NULL,
   `LABEL` varchar(200) DEFAULT NULL,
-  `INITIAL_COUNT` int(11) DEFAULT '0',
-  `MIN_INSTANCES` int(11) DEFAULT '0',
+  `INITIAL_COUNT` int(11) NOT NULL DEFAULT '0',
+  `MIN_INSTANCES` int(11) NOT NULL DEFAULT '0',
   `MAX_INSTANCES` int(11) DEFAULT NULL,
   `AVAILABILITY_ZONE_COUNT` int(11) DEFAULT NULL,
   `HEAT_ENVIRONMENT_ARTIFACT_UUID` varchar(200) DEFAULT NULL,
@@ -1233,7 +1233,7 @@
   `RESOURCE_TARGET` varchar(200) NOT NULL,
   `SOURCE` varchar(200) NOT NULL,
   `TIMEOUT_MINUTES` int(11) DEFAULT NULL,
-  `ARTIFACT_CHECKSUM` varchar(200) DEFAULT 'MANUAL RECORD',
+  `ARTIFACT_CHECKSUM` varchar(200) NOT NULL DEFAULT 'MANUAL RECORD',
   `CREATION_TIMESTAMP` datetime NOT NULL DEFAULT current_timestamp(),
   PRIMARY KEY (`ID`),
   UNIQUE KEY `UK_workflow` (`ARTIFACT_UUID`,`NAME`,`VERSION`,`SOURCE`)
diff --git a/asdc-controller/src/test/resources/schema.sql b/asdc-controller/src/test/resources/schema.sql
index 1260461..83be71e 100644
--- a/asdc-controller/src/test/resources/schema.sql
+++ b/asdc-controller/src/test/resources/schema.sql
@@ -651,7 +651,7 @@
   `TOSCA_NODE_TYPE` varchar(200) DEFAULT NULL,
   `AIC_VERSION_MIN` varchar(20) NULL,
   `AIC_VERSION_MAX` varchar(20) DEFAULT NULL,
-  `ORCHESTRATION_MODE` varchar(20) DEFAULT 'HEAT',
+  `ORCHESTRATION_MODE` varchar(20) NOT NULL DEFAULT 'HEAT',
   `CREATION_TIMESTAMP` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
   `RESOURCE_CATEGORY` varchar(200) DEFAULT NULL,
   `RESOURCE_SUB_CATEGORY` varchar(200) DEFAULT NULL,
@@ -961,8 +961,8 @@
   `ID` int(13) NOT NULL AUTO_INCREMENT,
   `MODEL_CUSTOMIZATION_UUID` varchar(200) NOT NULL,
   `LABEL` varchar(200) DEFAULT NULL,
-  `INITIAL_COUNT` int(11) DEFAULT '0',
-  `MIN_INSTANCES` int(11) DEFAULT '0',
+  `INITIAL_COUNT` int(11) NOT NULL DEFAULT '0',
+  `MIN_INSTANCES` int(11) NOT NULL DEFAULT '0',
   `MAX_INSTANCES` int(11) DEFAULT NULL,
   `AVAILABILITY_ZONE_COUNT` int(11) DEFAULT NULL,
   `HEAT_ENVIRONMENT_ARTIFACT_UUID` varchar(200) DEFAULT NULL,
@@ -1230,7 +1230,7 @@
   `RESOURCE_TARGET` varchar(200) NOT NULL,
   `SOURCE` varchar(200) NOT NULL,
   `TIMEOUT_MINUTES` int(11) DEFAULT NULL,
-  `ARTIFACT_CHECKSUM` varchar(200) DEFAULT 'MANUAL RECORD',
+  `ARTIFACT_CHECKSUM` varchar(200) NULL DEFAULT 'MANUAL RECORD',
   `CREATION_TIMESTAMP` datetime NOT NULL DEFAULT current_timestamp(),
   PRIMARY KEY (`ID`),
   UNIQUE KEY `UK_workflow` (`ARTIFACT_UUID`,`NAME`,`VERSION`,`SOURCE`)
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java
index d971689..7c283ab 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java
@@ -1936,7 +1936,8 @@
         if (relationshipsOp.isPresent()) {
             Relationships relationships = relationshipsOp.get();
             this.mapPlatform(relationships.getByType(Types.PLATFORM, uri -> uri.nodesOnly(true)), genericVnf);
-            this.mapLineOfBusiness(relationships.getByType(Types.LINE_OF_BUSINESS), genericVnf);
+            this.mapLineOfBusiness(relationships.getByType(Types.LINE_OF_BUSINESS, uri -> uri.nodesOnly(true)),
+                    genericVnf);
             genericVnf.getVolumeGroups().addAll(mapVolumeGroups(relationships.getByType(Types.VOLUME_GROUP)));
             genericVnf.getInstanceGroups().addAll(mapInstanceGroups(relationships.getByType(Types.INSTANCE_GROUP)));
         }
diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/ModelInfoVfModuleExpected.json b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/ModelInfoVfModuleExpected.json
index 1f9a8be..feff0f5 100644
--- a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/ModelInfoVfModuleExpected.json
+++ b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/ModelInfoVfModuleExpected.json
@@ -10,5 +10,5 @@
     "max-instances": 3,
     "availability-zone-count": 5,
     "label": "label",
-    "initial-count": null
+    "initial-count": 0
 }
\ No newline at end of file
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java
index aad8b51..4be497c 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java
@@ -28,6 +28,7 @@
 
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.ObjectMapper;
+import java.io.IOException;
 import org.apache.commons.lang3.SerializationUtils;
 import org.camunda.bpm.engine.delegate.DelegateExecution;
 import org.javatuples.Pair;
@@ -175,8 +176,7 @@
             String serviceInstanceId = getServiceInstanceId(execution, resourceId, resourceType);
 
             fillExecution(execution, requestDetails.getRequestInfo().getSuppressRollback(), resourceId, resourceType);
-            List<ExecuteBuildingBlock> flowsToExecute = new ArrayList<>();
-
+            List<ExecuteBuildingBlock> flowsToExecute;
             if (isRequestMacroServiceResume(isALaCarte, resourceType, requestAction, serviceInstanceId)) {
                 String errorMessage = "Could not resume Macro flow. Error loading execution path.";
                 flowsToExecute = loadExecuteBuildingBlocks(execution, requestId, errorMessage);
@@ -193,141 +193,13 @@
                 final String serviceType =
                         Optional.ofNullable((String) execution.getVariable(BBConstants.G_SERVICE_TYPE)).orElse("");
                 if (isALaCarte) {
-                    if (orchFlows == null || orchFlows.isEmpty()) {
-                        orchFlows = queryNorthBoundRequestCatalogDb(execution, requestAction, resourceType, true,
-                                cloudOwner, serviceType);
-                    }
-                    Resource resourceKey = getResourceKey(sIRequest, resourceType);
-
-                    ReplaceInstanceRelatedInformation replaceInfo = new ReplaceInstanceRelatedInformation();
-                    if ((requestAction.equalsIgnoreCase(REPLACEINSTANCE)
-                            || requestAction.equalsIgnoreCase(REPLACEINSTANCERETAINASSIGNMENTS))
-                            && resourceType.equals(WorkflowType.VFMODULE)) {
-                        logger.debug("Build a BB list for replacing BB modules");
-                        ConfigBuildingBlocksDataObject cbbdo = createConfigBuildingBlocksDataObject(execution,
-                                sIRequest, requestId, workflowResourceIds, requestDetails, requestAction, resourceId,
-                                vnfType, orchFlows, apiVersion, resourceKey, replaceInfo);
-                        orchFlows = getVfModuleReplaceBuildingBlocks(cbbdo);
-
-                        createBuildingBlocksForOrchFlows(execution, sIRequest, requestId, workflowResourceIds,
-                                requestDetails, requestAction, resourceId, flowsToExecute, vnfType, orchFlows,
-                                apiVersion, resourceKey, replaceInfo);
-                    } else {
-                        if (isConfiguration(orchFlows) && !requestAction.equalsIgnoreCase(CREATE_INSTANCE)) {
-                            addConfigBuildingBlocksToFlowsToExecuteList(execution, sIRequest, requestId,
-                                    workflowResourceIds, requestDetails, requestAction, resourceId, flowsToExecute,
-                                    vnfType, apiVersion, resourceKey, replaceInfo, orchFlows);
-                        }
-                        orchFlows =
-                                orchFlows.stream().filter(item -> !item.getFlowName().contains(FABRIC_CONFIGURATION))
-                                        .collect(Collectors.toList());
-
-                        for (OrchestrationFlow orchFlow : orchFlows) {
-                            ExecuteBuildingBlock ebb = executeBuildingBlockBuilder.buildExecuteBuildingBlock(orchFlow,
-                                    requestId, resourceKey, apiVersion, resourceId, requestAction, true, vnfType,
-                                    workflowResourceIds, requestDetails, false, null, null, false, replaceInfo);
-                            flowsToExecute.add(ebb);
-                        }
-                    }
+                    flowsToExecute = loadExecuteBuildingBlocksForAlaCarte(orchFlows, execution, requestAction,
+                            resourceType, cloudOwner, serviceType, sIRequest, requestId, workflowResourceIds,
+                            requestDetails, resourceId, vnfType, apiVersion);
                 } else {
-                    boolean containsService = false;
-                    List<Resource> resourceList = new ArrayList<>();
-                    List<Pair<WorkflowType, String>> aaiResourceIds = new ArrayList<>();
-                    List<Map<String, Object>> userParams =
-                            sIRequest.getRequestDetails().getRequestParameters().getUserParams();
-                    if (resourceType == WorkflowType.SERVICE && requestAction.equalsIgnoreCase(ASSIGNINSTANCE)) {
-                        // SERVICE-MACRO-ASSIGN will always get user params with a
-                        // service.
-
-                        if (userParams != null) {
-                            containsService = isContainsService(sIRequest);
-                            if (containsService) {
-                                resourceList = userParamsServiceTraversal.getResourceListFromUserParams(execution,
-                                        userParams, serviceInstanceId, requestAction);
-                            }
-                        } else {
-                            buildAndThrowException(execution,
-                                    "Service-Macro-Assign request details must contain user params with a service");
-                        }
-                    } else if (resourceType == WorkflowType.SERVICE
-                            && requestAction.equalsIgnoreCase(CREATE_INSTANCE)) {
-                        // SERVICE-MACRO-CREATE will get user params with a service,
-                        // a service with a network, a service with a
-                        // network collection, OR an empty service.
-                        // If user params is just a service or null and macro
-                        // queries the SI and finds a VNF, macro fails.
-
-                        if (userParams != null) {
-                            containsService = isContainsService(sIRequest);
-                        }
-                        if (containsService) {
-                            resourceList = userParamsServiceTraversal.getResourceListFromUserParams(execution,
-                                    userParams, serviceInstanceId, requestAction);
-                        }
-                        if (!foundRelated(resourceList)) {
-                            traverseCatalogDbService(execution, sIRequest, resourceList, aaiResourceIds);
-                        }
-                    } else if (resourceType == WorkflowType.SERVICE
-                            && ("activateInstance".equalsIgnoreCase(requestAction)
-                                    || "unassignInstance".equalsIgnoreCase(requestAction)
-                                    || "deleteInstance".equalsIgnoreCase(requestAction)
-                                    || requestAction.equalsIgnoreCase("activate" + FABRIC_CONFIGURATION))) {
-                        // SERVICE-MACRO-ACTIVATE, SERVICE-MACRO-UNASSIGN, and
-                        // SERVICE-MACRO-DELETE
-                        // Will never get user params with service, macro will have
-                        // to query the SI in AAI to find related instances.
-                        traverseAAIService(execution, resourceList, resourceId, aaiResourceIds);
-                    } else if (resourceType == WorkflowType.SERVICE
-                            && "deactivateInstance".equalsIgnoreCase(requestAction)) {
-                        resourceList.add(new Resource(WorkflowType.SERVICE, "", false));
-                    } else if (resourceType == WorkflowType.VNF && (REPLACEINSTANCE.equalsIgnoreCase(requestAction)
-                            || ("recreateInstance".equalsIgnoreCase(requestAction)))) {
-                        traverseAAIVnf(execution, resourceList, workflowResourceIds.getServiceInstanceId(),
-                                workflowResourceIds.getVnfId(), aaiResourceIds);
-                    } else if (resourceType == WorkflowType.VNF && "updateInstance".equalsIgnoreCase(requestAction)) {
-                        customTraverseAAIVnf(execution, resourceList, workflowResourceIds.getServiceInstanceId(),
-                                workflowResourceIds.getVnfId(), aaiResourceIds);
-                    } else {
-                        buildAndThrowException(execution, "Current Macro Request is not supported");
-                    }
-                    StringBuilder foundObjects = new StringBuilder();
-                    for (WorkflowType type : WorkflowType.values()) {
-                        foundObjects.append(type).append(" - ").append(
-                                (int) resourceList.stream().filter(x -> type.equals(x.getResourceType())).count())
-                                .append("    ");
-                    }
-                    logger.info("Found {}", foundObjects);
-
-                    if (orchFlows == null || orchFlows.isEmpty()) {
-                        orchFlows = queryNorthBoundRequestCatalogDb(execution, requestAction, resourceType, isALaCarte,
-                                cloudOwner, serviceType);
-                    }
-                    boolean vnfReplace = false;
-                    if (resourceType.equals(WorkflowType.VNF) && (REPLACEINSTANCE.equalsIgnoreCase(requestAction)
-                            || REPLACEINSTANCERETAINASSIGNMENTS.equalsIgnoreCase(requestAction))) {
-                        vnfReplace = true;
-                    }
-                    flowsToExecute = executeBuildingBlockBuilder.buildExecuteBuildingBlockList(orchFlows, resourceList,
-                            requestId, apiVersion, resourceId, requestAction, vnfType, workflowResourceIds,
-                            requestDetails, vnfReplace);
-                    if (isNetworkCollectionInTheResourceList(resourceList)) {
-                        logger.info("Sorting for Vlan Tagging");
-                        flowsToExecute = sortExecutionPathByObjectForVlanTagging(flowsToExecute, requestAction);
-                    }
-                    // By default, enable homing at VNF level for CREATE_INSTANCE and ASSIGNINSTANCE
-                    if (resourceType == WorkflowType.SERVICE
-                            && (requestAction.equals(CREATE_INSTANCE) || requestAction.equals(ASSIGNINSTANCE))
-                            && resourceList.stream().anyMatch(x -> WorkflowType.VNF.equals(x.getResourceType()))) {
-                        execution.setVariable(HOMING, true);
-                        execution.setVariable("calledHoming", false);
-                    }
-                    if (resourceType == WorkflowType.SERVICE && (requestAction.equalsIgnoreCase(ASSIGNINSTANCE)
-                            || requestAction.equalsIgnoreCase(CREATE_INSTANCE))) {
-                        generateResourceIds(flowsToExecute, resourceList, serviceInstanceId);
-                    } else {
-                        updateResourceIdsFromAAITraversal(flowsToExecute, resourceList, aaiResourceIds,
-                                serviceInstanceId);
-                    }
+                    flowsToExecute = loadExecuteBuildingBlocksForMacro(sIRequest, resourceType, requestAction,
+                            execution, serviceInstanceId, resourceId, workflowResourceIds, orchFlows, cloudOwner,
+                            serviceType, requestId, apiVersion, vnfType, requestDetails);
                 }
             }
             // If the user set "Homing_Solution" to "none", disable homing, else if "Homing_Solution" is specified,
@@ -368,6 +240,151 @@
         }
     }
 
+    private List<ExecuteBuildingBlock> loadExecuteBuildingBlocksForAlaCarte(List<OrchestrationFlow> orchFlows,
+            DelegateExecution execution, String requestAction, WorkflowType resourceType, String cloudOwner,
+            String serviceType, ServiceInstancesRequest sIRequest, String requestId,
+            WorkflowResourceIds workflowResourceIds, RequestDetails requestDetails, String resourceId, String vnfType,
+            String apiVersion) throws Exception {
+        List<ExecuteBuildingBlock> flowsToExecute = new ArrayList<>();
+        if (orchFlows == null || orchFlows.isEmpty()) {
+            orchFlows = queryNorthBoundRequestCatalogDb(execution, requestAction, resourceType, true, cloudOwner,
+                    serviceType);
+        }
+        Resource resourceKey = getResourceKey(sIRequest, resourceType);
+
+        ReplaceInstanceRelatedInformation replaceInfo = new ReplaceInstanceRelatedInformation();
+        if ((requestAction.equalsIgnoreCase(REPLACEINSTANCE)
+                || requestAction.equalsIgnoreCase(REPLACEINSTANCERETAINASSIGNMENTS))
+                && resourceType.equals(WorkflowType.VFMODULE)) {
+            logger.debug("Build a BB list for replacing BB modules");
+            ConfigBuildingBlocksDataObject cbbdo = createConfigBuildingBlocksDataObject(execution, sIRequest, requestId,
+                    workflowResourceIds, requestDetails, requestAction, resourceId, vnfType, orchFlows, apiVersion,
+                    resourceKey, replaceInfo);
+            orchFlows = getVfModuleReplaceBuildingBlocks(cbbdo);
+
+            createBuildingBlocksForOrchFlows(execution, sIRequest, requestId, workflowResourceIds, requestDetails,
+                    requestAction, resourceId, flowsToExecute, vnfType, orchFlows, apiVersion, resourceKey,
+                    replaceInfo);
+        } else {
+            if (isConfiguration(orchFlows) && !requestAction.equalsIgnoreCase(CREATE_INSTANCE)) {
+                addConfigBuildingBlocksToFlowsToExecuteList(execution, sIRequest, requestId, workflowResourceIds,
+                        requestDetails, requestAction, resourceId, flowsToExecute, vnfType, apiVersion, resourceKey,
+                        replaceInfo, orchFlows);
+            }
+            orchFlows = orchFlows.stream().filter(item -> !item.getFlowName().contains(FABRIC_CONFIGURATION))
+                    .collect(Collectors.toList());
+
+            for (OrchestrationFlow orchFlow : orchFlows) {
+                ExecuteBuildingBlock ebb = executeBuildingBlockBuilder.buildExecuteBuildingBlock(orchFlow, requestId,
+                        resourceKey, apiVersion, resourceId, requestAction, true, vnfType, workflowResourceIds,
+                        requestDetails, false, null, null, false, replaceInfo);
+                flowsToExecute.add(ebb);
+            }
+        }
+        return flowsToExecute;
+    }
+
+    private List<ExecuteBuildingBlock> loadExecuteBuildingBlocksForMacro(ServiceInstancesRequest sIRequest,
+            WorkflowType resourceType, String requestAction, DelegateExecution execution, String serviceInstanceId,
+            String resourceId, WorkflowResourceIds workflowResourceIds, List<OrchestrationFlow> orchFlows,
+            String cloudOwner, String serviceType, String requestId, String apiVersion, String vnfType,
+            RequestDetails requestDetails) throws IOException, VrfBondingServiceException {
+        List<ExecuteBuildingBlock> flowsToExecute;
+        boolean containsService = false;
+        List<Resource> resourceList = new ArrayList<>();
+        List<Pair<WorkflowType, String>> aaiResourceIds = new ArrayList<>();
+        List<Map<String, Object>> userParams = sIRequest.getRequestDetails().getRequestParameters().getUserParams();
+        if (resourceType == WorkflowType.SERVICE && requestAction.equalsIgnoreCase(ASSIGNINSTANCE)) {
+            // SERVICE-MACRO-ASSIGN will always get user params with a
+            // service.
+
+            if (userParams != null) {
+                containsService = isContainsService(sIRequest);
+                if (containsService) {
+                    resourceList = userParamsServiceTraversal.getResourceListFromUserParams(execution, userParams,
+                            serviceInstanceId, requestAction);
+                }
+            } else {
+                buildAndThrowException(execution,
+                        "Service-Macro-Assign request details must contain user params with a service");
+            }
+        } else if (resourceType == WorkflowType.SERVICE && requestAction.equalsIgnoreCase(CREATE_INSTANCE)) {
+            // SERVICE-MACRO-CREATE will get user params with a service,
+            // a service with a network, a service with a
+            // network collection, OR an empty service.
+            // If user params is just a service or null and macro
+            // queries the SI and finds a VNF, macro fails.
+
+            if (userParams != null) {
+                containsService = isContainsService(sIRequest);
+            }
+            if (containsService) {
+                resourceList = userParamsServiceTraversal.getResourceListFromUserParams(execution, userParams,
+                        serviceInstanceId, requestAction);
+            }
+            if (!foundRelated(resourceList)) {
+                traverseCatalogDbService(execution, sIRequest, resourceList, aaiResourceIds);
+            }
+        } else if (resourceType == WorkflowType.SERVICE && ("activateInstance".equalsIgnoreCase(requestAction)
+                || "unassignInstance".equalsIgnoreCase(requestAction)
+                || "deleteInstance".equalsIgnoreCase(requestAction)
+                || requestAction.equalsIgnoreCase("activate" + FABRIC_CONFIGURATION))) {
+            // SERVICE-MACRO-ACTIVATE, SERVICE-MACRO-UNASSIGN, and
+            // SERVICE-MACRO-DELETE
+            // Will never get user params with service, macro will have
+            // to query the SI in AAI to find related instances.
+            traverseAAIService(execution, resourceList, resourceId, aaiResourceIds);
+        } else if (resourceType == WorkflowType.SERVICE && "deactivateInstance".equalsIgnoreCase(requestAction)) {
+            resourceList.add(new Resource(WorkflowType.SERVICE, "", false));
+        } else if (resourceType == WorkflowType.VNF && (REPLACEINSTANCE.equalsIgnoreCase(requestAction)
+                || ("recreateInstance".equalsIgnoreCase(requestAction)))) {
+            traverseAAIVnf(execution, resourceList, workflowResourceIds.getServiceInstanceId(),
+                    workflowResourceIds.getVnfId(), aaiResourceIds);
+        } else if (resourceType == WorkflowType.VNF && "updateInstance".equalsIgnoreCase(requestAction)) {
+            customTraverseAAIVnf(execution, resourceList, workflowResourceIds.getServiceInstanceId(),
+                    workflowResourceIds.getVnfId(), aaiResourceIds);
+        } else {
+            buildAndThrowException(execution, "Current Macro Request is not supported");
+        }
+        StringBuilder foundObjects = new StringBuilder();
+        for (WorkflowType type : WorkflowType.values()) {
+            foundObjects.append(type).append(" - ")
+                    .append((int) resourceList.stream().filter(x -> type.equals(x.getResourceType())).count())
+                    .append("    ");
+        }
+        logger.info("Found {}", foundObjects);
+
+        if (orchFlows == null || orchFlows.isEmpty()) {
+            orchFlows = queryNorthBoundRequestCatalogDb(execution, requestAction, resourceType, false, cloudOwner,
+                    serviceType);
+        }
+        boolean vnfReplace = false;
+        if (resourceType.equals(WorkflowType.VNF) && (REPLACEINSTANCE.equalsIgnoreCase(requestAction)
+                || REPLACEINSTANCERETAINASSIGNMENTS.equalsIgnoreCase(requestAction))) {
+            vnfReplace = true;
+        }
+        flowsToExecute = executeBuildingBlockBuilder.buildExecuteBuildingBlockList(orchFlows, resourceList, requestId,
+                apiVersion, resourceId, requestAction, vnfType, workflowResourceIds, requestDetails, vnfReplace);
+        if (isNetworkCollectionInTheResourceList(resourceList)) {
+            logger.info("Sorting for Vlan Tagging");
+            flowsToExecute = sortExecutionPathByObjectForVlanTagging(flowsToExecute, requestAction);
+        }
+        // By default, enable homing at VNF level for CREATE_INSTANCE and ASSIGNINSTANCE
+        if (resourceType == WorkflowType.SERVICE
+                && (requestAction.equals(CREATE_INSTANCE) || requestAction.equals(ASSIGNINSTANCE))
+                && resourceList.stream().anyMatch(x -> WorkflowType.VNF.equals(x.getResourceType()))) {
+            execution.setVariable(HOMING, true);
+            execution.setVariable("calledHoming", false);
+        }
+        if (resourceType == WorkflowType.SERVICE && (requestAction.equalsIgnoreCase(ASSIGNINSTANCE)
+                || requestAction.equalsIgnoreCase(CREATE_INSTANCE))) {
+            generateResourceIds(flowsToExecute, resourceList, serviceInstanceId);
+        } else {
+            updateResourceIdsFromAAITraversal(flowsToExecute, resourceList, aaiResourceIds, serviceInstanceId);
+        }
+        return flowsToExecute;
+    }
+
     private void setExecutionVariables(DelegateExecution execution, List<ExecuteBuildingBlock> flowsToExecute,
             List<String> flowNames) {
         execution.setVariable("flowNames", flowNames);
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionExtractResourcesAAITest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionExtractResourcesAAITest.java
index 35a5bfe..7ac245d 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionExtractResourcesAAITest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionExtractResourcesAAITest.java
@@ -56,7 +56,8 @@
     public void extractRelationshipsConfigurationSuccess() {
         // given
         Relationships relationships = mock(Relationships.class);
-        when(relationships.getByType(Types.CONFIGURATION)).thenReturn(getConfigurationList());
+        when(relationships.getByType(Types.CONFIGURATION))
+                .thenReturn(getConfigurationList("{\"configuration-id\" : \"" + CONFIGURATION_ID + "\"}"));
         // when
         Optional<Configuration> resultOpt = testedObject.extractRelationshipsConfiguration(relationships);
         // then
@@ -65,7 +66,18 @@
     }
 
     @Test
-    public void extractRelationshipsConfiguration_notFound() {
+    public void extractRelationshipsConfiguration_noConfigurationFoundInList() {
+        // given
+        Relationships relationships = mock(Relationships.class);
+        when(relationships.getByType(Types.CONFIGURATION)).thenReturn(getConfigurationList("noJson"));
+        // when
+        Optional<Configuration> resultOpt = testedObject.extractRelationshipsConfiguration(relationships);
+        // then
+        assertThat(resultOpt).isEmpty();
+    }
+
+    @Test
+    public void extractRelationshipsConfiguration_notFound_listEmpty() {
         // given
         Relationships relationships = mock(Relationships.class);
         when(relationships.getByType(Types.CONFIGURATION)).thenReturn(Collections.emptyList());
@@ -92,10 +104,71 @@
         assertThat(resultOpt.get().getVpnId()).isEqualTo(VPN_ID);
     }
 
-    private List<AAIResultWrapper> getConfigurationList() {
+    @Test
+    public void extractRelationshipsVpnBinding_noVpnBindingFoundInList() {
+        // given
+        Relationships relationships = mock(Relationships.class);
+        AAIResourceUri aaiResourceUri = mock(AAISimpleUri.class);
+        List<AAIResourceUri> aaiResourceUriList = new ArrayList<>();
+        aaiResourceUriList.add(aaiResourceUri);
+        when(relationships.getRelatedUris(Types.VPN_BINDING)).thenReturn(aaiResourceUriList);
+        AAIResultWrapper aaiResultWrapper = new AAIResultWrapper("noJson");
+        when(bbInputSetupUtils.getAAIResourceDepthOne(aaiResourceUri)).thenReturn(aaiResultWrapper);
+        // when
+        Optional<VpnBinding> resultOpt = testedObject.extractRelationshipsVpnBinding(relationships);
+        // then
+        assertThat(resultOpt).isEmpty();
+    }
+
+    @Test
+    public void extractRelationshipsVpnBinding_notFound_listEmpty() {
+        // given
+        Relationships relationships = mock(Relationships.class);
+        when(relationships.getRelatedUris(Types.VPN_BINDING)).thenReturn(Collections.emptyList());
+        // when
+        Optional<VpnBinding> resultOpt = testedObject.extractRelationshipsVpnBinding(relationships);
+        // then
+        assertThat(resultOpt).isEmpty();
+    }
+
+    @Test
+    public void extractRelationshipsVnfcSuccess() {
+        // given
+        Relationships relationships = mock(Relationships.class);
+        when(relationships.getByType(Types.VNFC)).thenReturn(
+                getConfigurationList("{\"relationship-list\": {\"relationship\": [{\"related-to\": \"tenant\"}]}}"));
+        // when
+        Optional<Relationships> resultOpt = testedObject.extractRelationshipsVnfc(relationships);
+        // then
+        assertThat(resultOpt).isNotEmpty();
+        assertThat(resultOpt.get().getJson()).isEqualTo("{\"relationship\":[{\"related-to\":\"tenant\"}]}");
+    }
+
+    @Test
+    public void extractRelationshipsVnfc_noRelationFoundList() {
+        // given
+        Relationships relationships = mock(Relationships.class);
+        when(relationships.getByType(Types.VNFC)).thenReturn(getConfigurationList("{\"jsonWithNoRelation\": {}}"));
+        // when
+        Optional<Relationships> resultOpt = testedObject.extractRelationshipsVnfc(relationships);
+        // then
+        assertThat(resultOpt).isEmpty();
+    }
+
+    @Test
+    public void extractRelationshipsVnfc_notFound_listEmpty() {
+        // given
+        Relationships relationships = mock(Relationships.class);
+        when(relationships.getByType(Types.VNFC)).thenReturn(Collections.emptyList());
+        // when
+        Optional<Relationships> resultOpt = testedObject.extractRelationshipsVnfc(relationships);
+        // then
+        assertThat(resultOpt).isEmpty();
+    }
+
+    private List<AAIResultWrapper> getConfigurationList(String json) {
         List<AAIResultWrapper> configurations = new ArrayList<>();
-        AAIResultWrapper aaiResultWrapper =
-                new AAIResultWrapper("{\"configuration-id\" : \"" + CONFIGURATION_ID + "\"}");
+        AAIResultWrapper aaiResultWrapper = new AAIResultWrapper(json);
         configurations.add(aaiResultWrapper);
         return configurations;
     }
diff --git a/common/src/main/java/org/onap/so/security/SoCadiFilter.java b/common/src/main/java/org/onap/so/security/SoCadiFilter.java
index 06d0795..1660220 100644
--- a/common/src/main/java/org/onap/so/security/SoCadiFilter.java
+++ b/common/src/main/java/org/onap/so/security/SoCadiFilter.java
@@ -35,7 +35,8 @@
 
 @Component
 @Profile("!test & aaf")
-@Priority(0)
+// Run right before default priority of 0 to block requests
+@Priority(-1)
 public class SoCadiFilter extends CadiFilter {
 
     protected final Logger logger = LoggerFactory.getLogger(SoCadiFilter.class);
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/schema.sql b/mso-api-handlers/mso-api-handler-infra/src/test/resources/schema.sql
index 11f2d4b..e0ec216 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/schema.sql
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/schema.sql
@@ -651,7 +651,7 @@
   `TOSCA_NODE_TYPE` varchar(200) DEFAULT NULL,
   `AIC_VERSION_MIN` varchar(20) NULL,
   `AIC_VERSION_MAX` varchar(20) DEFAULT NULL,
-  `ORCHESTRATION_MODE` varchar(20) DEFAULT 'HEAT',
+  `ORCHESTRATION_MODE` varchar(20) NOT NULL DEFAULT 'HEAT',
   `CREATION_TIMESTAMP` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
   `RESOURCE_CATEGORY` varchar(200) DEFAULT NULL,
   `RESOURCE_SUB_CATEGORY` varchar(200) DEFAULT NULL,
@@ -958,8 +958,8 @@
   `ID` int(13) NOT NULL AUTO_INCREMENT,
   `MODEL_CUSTOMIZATION_UUID` varchar(200) NOT NULL,
   `LABEL` varchar(200) DEFAULT NULL,
-  `INITIAL_COUNT` int(11) DEFAULT '0',
-  `MIN_INSTANCES` int(11) DEFAULT '0',
+  `INITIAL_COUNT` int(11) NOT NULL DEFAULT '0',
+  `MIN_INSTANCES` int(11) NOT NULL DEFAULT '0',
   `MAX_INSTANCES` int(11) DEFAULT NULL,
   `AVAILABILITY_ZONE_COUNT` int(11) DEFAULT NULL,
   `HEAT_ENVIRONMENT_ARTIFACT_UUID` varchar(200) DEFAULT NULL,
@@ -1493,7 +1493,7 @@
   `RESOURCE_TARGET` varchar(200) NOT NULL,
   `SOURCE` varchar(200) NOT NULL,
   `TIMEOUT_MINUTES` int(11) DEFAULT NULL,
-  `ARTIFACT_CHECKSUM` varchar(200) DEFAULT 'MANUAL RECORD',
+  `ARTIFACT_CHECKSUM` varchar(200) NULL DEFAULT 'MANUAL RECORD',
   `CREATION_TIMESTAMP` datetime NOT NULL DEFAULT current_timestamp(),
   PRIMARY KEY (`ID`),
   UNIQUE KEY `UK_workflow` (`ARTIFACT_UUID`,`NAME`,`VERSION`,`SOURCE`)
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudIdentity.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudIdentity.java
index 63ee35c..c3617b6 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudIdentity.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudIdentity.java
@@ -76,8 +76,8 @@
 
     @JsonProperty("admin_project_domain_name ")
     @BusinessKey
-    @Column(name = "ADMIN_PROJECT_DOMAIN_NAME")
-    private String adminProjectDomainName;
+    @Column(name = "ADMIN_PROJECT_DOMAIN_NAME", nullable = false)
+    private String adminProjectDomainName = "Default";
 
     @JsonProperty("user_domain_name")
     @BusinessKey
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudSite.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudSite.java
index 8e3f475..64c4b62 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudSite.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudSite.java
@@ -127,7 +127,7 @@
 
     @JsonProperty("support_fabric")
     @BusinessKey
-    @Column(name = "SUPPORT_FABRIC")
+    @Column(name = "SUPPORT_FABRIC", nullable = false)
     private Boolean supportFabric = true;
 
     @Transient
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/NetworkResource.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/NetworkResource.java
index 65444d0..f35008a 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/NetworkResource.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/NetworkResource.java
@@ -55,8 +55,8 @@
     @Column(name = "MODEL_UUID")
     private String modelUUID;
 
-    @Column(name = "ORCHESTRATION_MODE")
-    private String orchestrationMode = null;
+    @Column(name = "ORCHESTRATION_MODE", nullable = false)
+    private String orchestrationMode = "HEAT";
 
     @Column(name = "DESCRIPTION")
     private String description = null;
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResourceCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResourceCustomization.java
index 122a20f..2dea0bb 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResourceCustomization.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResourceCustomization.java
@@ -82,8 +82,8 @@
     @Column(name = "CDS_BLUEPRINT_VERSION")
     private String blueprintVersion;
 
-    @Column(name = "SKIP_POST_INSTANTIATION_CONFIGURATION")
-    private boolean skipPostInstConf;
+    @Column(name = "SKIP_POST_INSTANTIATION_CONFIGURATION", nullable = false)
+    private boolean skipPostInstConf = true;
 
     @Column(name = "CONTROLLER_ACTOR")
     private String controllerActor;
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Service.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Service.java
index 487b3c6..3cca869 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Service.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Service.java
@@ -159,8 +159,8 @@
     @Column(name = "CDS_BLUEPRINT_VERSION")
     private String blueprintVersion;
 
-    @Column(name = "SKIP_POST_INSTANTIATION_CONFIGURATION")
-    private Boolean skipPostInstConf;
+    @Column(name = "SKIP_POST_INSTANTIATION_CONFIGURATION", nullable = false)
+    private Boolean skipPostInstConf = true;
 
     @Column(name = "CONTROLLER_ACTOR")
     private String controllerActor;
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VfModuleCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VfModuleCustomization.java
index 5cacec7..f745bb8 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VfModuleCustomization.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VfModuleCustomization.java
@@ -64,14 +64,14 @@
     @Column(name = "LABEL")
     private String label;
 
-    @Column(name = "MIN_INSTANCES")
-    private Integer minInstances;
+    @Column(name = "MIN_INSTANCES", nullable = false)
+    private Integer minInstances = 0;
 
     @Column(name = "MAX_INSTANCES")
     private Integer maxInstances;
 
-    @Column(name = "INITIAL_COUNT")
-    private Integer initialCount;
+    @Column(name = "INITIAL_COUNT", nullable = false)
+    private Integer initialCount = 0;
 
     @Column(name = "AVAILABILITY_ZONE_COUNT")
     private Integer availabilityZoneCount;
@@ -100,8 +100,8 @@
     @OneToMany(cascade = CascadeType.ALL, mappedBy = "vfModuleCustomization")
     private List<CvnfcCustomization> cvnfcCustomization;
 
-    @Column(name = "SKIP_POST_INSTANTIATION_CONFIGURATION")
-    private Boolean skipPostInstConf;
+    @Column(name = "SKIP_POST_INSTANTIATION_CONFIGURATION", nullable = false)
+    private Boolean skipPostInstConf = true;
 
     @Override
     public boolean equals(final Object other) {
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResourceCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResourceCustomization.java
index 1b1df21..740e51a 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResourceCustomization.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResourceCustomization.java
@@ -117,14 +117,14 @@
     @Column(name = "CDS_BLUEPRINT_VERSION")
     private String blueprintVersion;
 
-    @Column(name = "SKIP_POST_INSTANTIATION_CONFIGURATION")
+    @Column(name = "SKIP_POST_INSTANTIATION_CONFIGURATION", nullable = false)
     private Boolean skipPostInstConf = true;
 
     @Column(name = "VNFCINSTANCEGROUP_ORDER")
     private String vnfcInstanceGroupOrder;
 
-    @Column(name = "NF_DATA_VALID")
-    private Boolean nfDataValid;
+    @Column(name = "NF_DATA_VALID", nullable = false)
+    private Boolean nfDataValid = false;
 
     @Column(name = "CONTROLLER_ACTOR")
     private String controllerActor;
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Workflow.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Workflow.java
index 05e8ddc..77dc95a 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Workflow.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Workflow.java
@@ -65,8 +65,8 @@
     @Column(name = "TIMEOUT_MINUTES")
     private Integer timeoutMinutes;
 
-    @Column(name = "ARTIFACT_CHECKSUM")
-    private String artifactChecksum;
+    @Column(name = "ARTIFACT_CHECKSUM", nullable = false)
+    private String artifactChecksum = "RECORD";
 
     @Column(name = "CREATION_TIMESTAMP", updatable = false)
     @Temporal(TemporalType.TIMESTAMP)
diff --git a/mso-catalog-db/src/test/resources/schema.sql b/mso-catalog-db/src/test/resources/schema.sql
index 335c49e..86f56ca 100644
--- a/mso-catalog-db/src/test/resources/schema.sql
+++ b/mso-catalog-db/src/test/resources/schema.sql
@@ -650,7 +650,7 @@
   `TOSCA_NODE_TYPE` varchar(200) DEFAULT NULL,
   `AIC_VERSION_MIN` varchar(20) NULL,
   `AIC_VERSION_MAX` varchar(20) DEFAULT NULL,
-  `ORCHESTRATION_MODE` varchar(20) DEFAULT 'HEAT',
+  `ORCHESTRATION_MODE` varchar(20) NOT NULL DEFAULT 'HEAT',
   `CREATION_TIMESTAMP` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
   `RESOURCE_CATEGORY` varchar(200) DEFAULT NULL,
   `RESOURCE_SUB_CATEGORY` varchar(200) DEFAULT NULL,
@@ -960,8 +960,8 @@
   `ID` int(13) NOT NULL AUTO_INCREMENT,
   `MODEL_CUSTOMIZATION_UUID` varchar(200) NOT NULL,
   `LABEL` varchar(200) DEFAULT NULL,
-  `INITIAL_COUNT` int(11) DEFAULT '0',
-  `MIN_INSTANCES` int(11) DEFAULT '0',
+  `INITIAL_COUNT` int(11) NOT NULL DEFAULT '0',
+  `MIN_INSTANCES` int(11) NOT NULL DEFAULT '0',
   `MAX_INSTANCES` int(11) DEFAULT NULL,
   `AVAILABILITY_ZONE_COUNT` int(11) DEFAULT NULL,
   `HEAT_ENVIRONMENT_ARTIFACT_UUID` varchar(200) DEFAULT NULL,
@@ -1228,7 +1228,7 @@
   `RESOURCE_TARGET` varchar(200) NOT NULL,
   `SOURCE` varchar(200) NOT NULL,
   `TIMEOUT_MINUTES` int(11) DEFAULT NULL,
-  `ARTIFACT_CHECKSUM` varchar(200) DEFAULT 'MANUAL RECORD',
+  `ARTIFACT_CHECKSUM` varchar(200) NOT NULL DEFAULT 'MANUAL RECORD',
   `CREATION_TIMESTAMP` datetime NOT NULL DEFAULT current_timestamp(),
   PRIMARY KEY (`ID`),
   UNIQUE KEY `UK_workflow` (`ARTIFACT_UUID`,`NAME`,`VERSION`,`SOURCE`)