Merge "Add SO update config file -application.yaml file" into dublin
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExtractPojosForBB.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExtractPojosForBB.java
index 4332a6c..86bbead 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExtractPojosForBB.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExtractPojosForBB.java
@@ -47,7 +47,7 @@
         return extractByKey(execution, key, execution.getLookupMap().get(key));
     }
 
-    public <T> T extractByKey(BuildingBlockExecution execution, ResourceKey key, String value)
+    protected <T> T extractByKey(BuildingBlockExecution execution, ResourceKey key, String value)
             throws BBObjectNotFoundException {
 
         Optional<T> result = Optional.empty();
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasks.java
index 3304d1b..01bdc09 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasks.java
@@ -481,6 +481,16 @@
         }
     }
 
+    public void updateOrchestrationStatusAssignFabricConfiguration(BuildingBlockExecution execution) {
+        try {
+            Configuration configuration = extractPojosForBB.extractByKey(execution, ResourceKey.CONFIGURATION_ID);
+            aaiConfigurationResources.updateOrchestrationStatusConfiguration(configuration,
+                    OrchestrationStatus.ASSIGNED);
+        } catch (Exception ex) {
+            exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
+        }
+    }
+
     public void updateOrchestrationStatusActivateFabricConfiguration(BuildingBlockExecution execution) {
         try {
             Configuration configuration = extractPojosForBB.extractByKey(execution, ResourceKey.CONFIGURATION_ID);
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIConfigurationResources.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIConfigurationResources.java
index 746f136..1453e40 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIConfigurationResources.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIConfigurationResources.java
@@ -49,7 +49,7 @@
     public void createConfiguration(Configuration configuration) {
         AAIResourceUri configurationURI =
                 AAIUriFactory.createResourceUri(AAIObjectType.CONFIGURATION, configuration.getConfigurationId());
-        configuration.setOrchestrationStatus(OrchestrationStatus.ASSIGNED);
+        configuration.setOrchestrationStatus(OrchestrationStatus.INVENTORIED);
         org.onap.aai.domain.yang.Configuration aaiConfiguration = aaiObjectMapper.mapConfiguration(configuration);
         injectionHelper.getAaiClient().create(configurationURI, aaiConfiguration);
     }
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasksTest.java
index 7109ac8..905f244 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasksTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasksTest.java
@@ -666,6 +666,18 @@
     }
 
     @Test
+    public void updateOrchestrationStatusAssignedFabricConfigurationTest() throws Exception {
+        gBBInput = execution.getGeneralBuildingBlock();
+        doNothing().when(aaiConfigurationResources).updateOrchestrationStatusConfiguration(configuration,
+                OrchestrationStatus.ASSIGNED);
+
+        aaiUpdateTasks.updateOrchestrationStatusAssignFabricConfiguration(execution);
+
+        verify(aaiConfigurationResources, times(1)).updateOrchestrationStatusConfiguration(configuration,
+                OrchestrationStatus.ASSIGNED);
+    }
+
+    @Test
     public void updateContrailServiceInstanceFqdnVfModuleTest() throws Exception {
         execution.setVariable("contrailServiceInstanceFqdn", "newContrailServiceInstanceFqdn");
         doNothing().when(aaiVfModuleResources).updateContrailServiceInstanceFqdnVfModule(vfModule, genericVnf);
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAIConfigurationResourcesTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAIConfigurationResourcesTest.java
index 2e1a40d..be58ccb 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAIConfigurationResourcesTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAIConfigurationResourcesTest.java
@@ -98,7 +98,7 @@
 
         aaiConfigurationResources.createConfiguration(configuration);
 
-        assertEquals(OrchestrationStatus.ASSIGNED, configuration.getOrchestrationStatus());
+        assertEquals(OrchestrationStatus.INVENTORIED, configuration.getOrchestrationStatus());
         verify(MOCK_aaiResourcesClient, times(1)).create(any(AAIResourceUri.class),
                 isA(org.onap.aai.domain.yang.Configuration.class));
     }