Metadata for name, version, tags and type
[ccsdk/cds.git] / ms / blueprintsprocessor / functions / config-snapshots / src / test / kotlin / org / onap / ccsdk / cds / blueprintsprocessor / functions / config / snapshots / ComponentConfigSnapshotsExecutorTest.kt
index c212908..c6166eb 100644 (file)
@@ -23,11 +23,7 @@ import org.junit.Assert.assertTrue
 import org.junit.Before
 import org.junit.Test
 import org.junit.runner.RunWith
-import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintProperties
-import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertyConfiguration
 import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput
-import org.onap.ccsdk.cds.blueprintsprocessor.db.BluePrintDBLibConfiguration
-import org.onap.ccsdk.cds.blueprintsprocessor.functions.config.snapshots.ComponentConfigSnapshotsExecutor
 import org.onap.ccsdk.cds.blueprintsprocessor.functions.config.snapshots.ComponentConfigSnapshotsExecutor.Companion.DIFF_JSON
 import org.onap.ccsdk.cds.blueprintsprocessor.functions.config.snapshots.ComponentConfigSnapshotsExecutor.Companion.DIFF_XML
 import org.onap.ccsdk.cds.blueprintsprocessor.functions.config.snapshots.ComponentConfigSnapshotsExecutor.Companion.OPERATION_DIFF
@@ -37,31 +33,32 @@ import org.onap.ccsdk.cds.blueprintsprocessor.functions.config.snapshots.db.Reso
 import org.onap.ccsdk.cds.blueprintsprocessor.functions.config.snapshots.db.ResourceConfigSnapshotService
 import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException
 import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive
-import org.onap.ccsdk.cds.controllerblueprints.core.config.BluePrintLoadConfiguration
 import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintMetadataUtils
 import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils
 import org.springframework.beans.factory.annotation.Autowired
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration
 import org.springframework.context.annotation.ComponentScan
 import org.springframework.test.context.ContextConfiguration
 import org.springframework.test.context.TestPropertySource
 import org.springframework.test.context.junit4.SpringRunner
 
 @RunWith(SpringRunner::class)
-@ContextConfiguration(classes = [ResourceConfigSnapshotService::class,
-    BlueprintPropertyConfiguration::class, BluePrintProperties::class,
-    BluePrintDBLibConfiguration::class, BluePrintLoadConfiguration::class])
+@ContextConfiguration(
+    classes = [ResourceConfigSnapshotService::class, TestDatabaseConfiguration::class]
+)
 @TestPropertySource(locations = ["classpath:application-test.properties"])
-@ComponentScan(basePackages = ["org.onap.ccsdk.cds.blueprintsprocessor", "org.onap.ccsdk.cds.controllerblueprints"])
-@EnableAutoConfiguration
+@ComponentScan(
+    basePackages = ["org.onap.ccsdk.cds.blueprintsprocessor.functions.config.snapshots"]
+)
 @Suppress("SameParameterValue")
 class ComponentConfigSnapshotsExecutorTest {
 
     @Autowired
-    lateinit var cfgSnapshotService : ResourceConfigSnapshotService
-    lateinit var cfgSnapshotComponent : ComponentConfigSnapshotsExecutor
-    private var bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime("123456-1000",
-            "./../../../../components/model-catalog/blueprint-model/test-blueprint/remote_scripts")
+    lateinit var cfgSnapshotService: ResourceConfigSnapshotService
+    lateinit var cfgSnapshotComponent: ComponentConfigSnapshotsExecutor
+    private var bluePrintRuntimeService = BluePrintMetadataUtils.bluePrintRuntime(
+        "123456-1000",
+        "./../../../../components/model-catalog/blueprint-model/test-blueprint/remote_scripts"
+    )
 
     private val resourceId = "1"
     private val resourceType = "ServiceInstance"
@@ -76,7 +73,6 @@ class ComponentConfigSnapshotsExecutorTest {
         props[ComponentConfigSnapshotsExecutor.INPUT_RESOURCE_ID] = resourceId.asJsonPrimitive()
         props[ComponentConfigSnapshotsExecutor.INPUT_RESOURCE_TYPE] = resourceType.asJsonPrimitive()
 
-
         cfgSnapshotComponent.operationInputs = props
         cfgSnapshotComponent.bluePrintRuntimeService = bluePrintRuntimeService
         cfgSnapshotComponent.nodeTemplateName = nodeTemplateName
@@ -104,17 +100,27 @@ class ComponentConfigSnapshotsExecutorTest {
 
                 cfgSnapshotComponent.processNB(executionRequest)
             } catch (e: BluePrintProcessorException) {
-                kotlin.test.assertEquals("Can't proceed with the cfg snapshot lookup: provide resource-id and resource-type.",
-                        e.message)
+                kotlin.test.assertEquals(
+                    "Can't proceed with the cfg snapshot lookup: provide resource-id and resource-type.",
+                    e.message
+                )
                 return@runBlocking
             }
             // then; we should get success and the TEST1 payload in our output properties
-            assertEquals(ComponentConfigSnapshotsExecutor.OUTPUT_STATUS_SUCCESS.asJsonPrimitive(),
-                    bluePrintRuntimeService.getNodeTemplateAttributeValue(nodeTemplateName,
-                            ComponentConfigSnapshotsExecutor.OUTPUT_STATUS))
-            assertEquals(snapshotConfig.asJsonPrimitive(),
-                    bluePrintRuntimeService.getNodeTemplateAttributeValue(nodeTemplateName,
-                            ComponentConfigSnapshotsExecutor.OUTPUT_SNAPSHOT))
+            assertEquals(
+                ComponentConfigSnapshotsExecutor.OUTPUT_STATUS_SUCCESS.asJsonPrimitive(),
+                bluePrintRuntimeService.getNodeTemplateAttributeValue(
+                    nodeTemplateName,
+                    ComponentConfigSnapshotsExecutor.OUTPUT_STATUS
+                )
+            )
+            assertEquals(
+                snapshotConfig.asJsonPrimitive(),
+                bluePrintRuntimeService.getNodeTemplateAttributeValue(
+                    nodeTemplateName,
+                    ComponentConfigSnapshotsExecutor.OUTPUT_SNAPSHOT
+                )
+            )
         }
     }
 
@@ -128,22 +134,32 @@ class ComponentConfigSnapshotsExecutorTest {
             try {
                 val resId = "121111"
                 val resType = "PNF"
-                cfgSnapshotService.write(snapshotConfig, resId, resType,  ResourceConfigSnapshot.Status.CANDIDATE)
+                cfgSnapshotService.write(snapshotConfig, resId, resType, ResourceConfigSnapshot.Status.CANDIDATE)
                 prepareRequestProperties(OPERATION_FETCH, resId, resType, ResourceConfigSnapshot.Status.CANDIDATE.name)
 
                 cfgSnapshotComponent.processNB(executionRequest)
             } catch (e: BluePrintProcessorException) {
-                kotlin.test.assertEquals("Can't proceed with the cfg snapshot lookup: provide resource-id and resource-type.",
-                        e.message)
+                kotlin.test.assertEquals(
+                    "Can't proceed with the cfg snapshot lookup: provide resource-id and resource-type.",
+                    e.message
+                )
                 return@runBlocking
             }
             // then; we should get success and the TEST payload in our output properties
-            assertEquals(ComponentConfigSnapshotsExecutor.OUTPUT_STATUS_SUCCESS.asJsonPrimitive(),
-                    bluePrintRuntimeService.getNodeTemplateAttributeValue(nodeTemplateName,
-                            ComponentConfigSnapshotsExecutor.OUTPUT_STATUS))
-            assertEquals(snapshotConfig.asJsonPrimitive(),
-                    bluePrintRuntimeService.getNodeTemplateAttributeValue(nodeTemplateName,
-                            ComponentConfigSnapshotsExecutor.OUTPUT_SNAPSHOT))
+            assertEquals(
+                ComponentConfigSnapshotsExecutor.OUTPUT_STATUS_SUCCESS.asJsonPrimitive(),
+                bluePrintRuntimeService.getNodeTemplateAttributeValue(
+                    nodeTemplateName,
+                    ComponentConfigSnapshotsExecutor.OUTPUT_STATUS
+                )
+            )
+            assertEquals(
+                snapshotConfig.asJsonPrimitive(),
+                bluePrintRuntimeService.getNodeTemplateAttributeValue(
+                    nodeTemplateName,
+                    ComponentConfigSnapshotsExecutor.OUTPUT_SNAPSHOT
+                )
+            )
         }
     }
 
@@ -160,20 +176,29 @@ class ComponentConfigSnapshotsExecutorTest {
                 prepareRequestProperties(OPERATION_STORE, resId, resType, snapshotConfig)
 
                 cfgSnapshotComponent.processNB(executionRequest)
-
             } catch (e: BluePrintProcessorException) {
-                kotlin.test.assertEquals("Can't proceed with the cfg snapshot lookup: provide resource-id and resource-type.",
-                        e.message)
+                kotlin.test.assertEquals(
+                    "Can't proceed with the cfg snapshot lookup: provide resource-id and resource-type.",
+                    e.message
+                )
                 return@runBlocking
             }
 
             // then; we should get success and the PAYLOAD payload in our output properties
-            assertEquals(ComponentConfigSnapshotsExecutor.OUTPUT_STATUS_SUCCESS.asJsonPrimitive(),
-                    bluePrintRuntimeService.getNodeTemplateAttributeValue(nodeTemplateName,
-                            ComponentConfigSnapshotsExecutor.OUTPUT_STATUS))
-            assertEquals(snapshotConfig.asJsonPrimitive(),
-                    bluePrintRuntimeService.getNodeTemplateAttributeValue(nodeTemplateName,
-                            ComponentConfigSnapshotsExecutor.OUTPUT_SNAPSHOT))
+            assertEquals(
+                ComponentConfigSnapshotsExecutor.OUTPUT_STATUS_SUCCESS.asJsonPrimitive(),
+                bluePrintRuntimeService.getNodeTemplateAttributeValue(
+                    nodeTemplateName,
+                    ComponentConfigSnapshotsExecutor.OUTPUT_STATUS
+                )
+            )
+            assertEquals(
+                snapshotConfig.asJsonPrimitive(),
+                bluePrintRuntimeService.getNodeTemplateAttributeValue(
+                    nodeTemplateName,
+                    ComponentConfigSnapshotsExecutor.OUTPUT_SNAPSHOT
+                )
+            )
         }
     }
 
@@ -183,19 +208,24 @@ class ComponentConfigSnapshotsExecutorTest {
         runBlocking {
             // when; asking for unknown resource Id/ resource Type combo; should get an error response
             try {
-                prepareRequestProperties(OPERATION_FETCH, "asdasd",  "PNF", ResourceConfigSnapshot.Status.RUNNING.name)
+                prepareRequestProperties(OPERATION_FETCH, "asdasd", "PNF", ResourceConfigSnapshot.Status.RUNNING.name)
 
                 cfgSnapshotComponent.processNB(executionRequest)
-
             } catch (e: BluePrintProcessorException) {
-                kotlin.test.assertEquals("Can't proceed with the cfg snapshot lookup: provide resource-id and resource-type.",
-                        e.message)
+                kotlin.test.assertEquals(
+                    "Can't proceed with the cfg snapshot lookup: provide resource-id and resource-type.",
+                    e.message
+                )
                 return@runBlocking
             }
 
-            assertEquals(ComponentConfigSnapshotsExecutor.OUTPUT_STATUS_SUCCESS.asJsonPrimitive(),
-                    bluePrintRuntimeService.getNodeTemplateAttributeValue(nodeTemplateName,
-                            ComponentConfigSnapshotsExecutor.OUTPUT_STATUS))
+            assertEquals(
+                ComponentConfigSnapshotsExecutor.OUTPUT_STATUS_SUCCESS.asJsonPrimitive(),
+                bluePrintRuntimeService.getNodeTemplateAttributeValue(
+                    nodeTemplateName,
+                    ComponentConfigSnapshotsExecutor.OUTPUT_STATUS
+                )
+            )
         }
     }
 
@@ -205,25 +235,34 @@ class ComponentConfigSnapshotsExecutorTest {
         runBlocking {
             // when; asking for unknown operation update; should get an error response
             try {
-                prepareRequestProperties("update", "asdasd",  "PNF", ResourceConfigSnapshot.Status.RUNNING.name)
+                prepareRequestProperties("update", "asdasd", "PNF", ResourceConfigSnapshot.Status.RUNNING.name)
 
                 cfgSnapshotComponent.processNB(executionRequest)
-
             } catch (e: BluePrintProcessorException) {
-                kotlin.test.assertEquals("Can't proceed with the cfg snapshot lookup: provide resource-id and resource-type.",
-                        e.message)
+                kotlin.test.assertEquals(
+                    "Can't proceed with the cfg snapshot lookup: provide resource-id and resource-type.",
+                    e.message
+                )
                 return@runBlocking
             }
 
             // then; we should get error in our output properties
-            assertTrue( bluePrintRuntimeService.getBluePrintError().errors.size == 1 )
-            assertEquals(ComponentConfigSnapshotsExecutor.OUTPUT_STATUS_ERROR.asJsonPrimitive(),
-                    bluePrintRuntimeService.getNodeTemplateAttributeValue(nodeTemplateName,
-                            ComponentConfigSnapshotsExecutor.OUTPUT_STATUS))
+            assertTrue(bluePrintRuntimeService.getBluePrintError().errors.size == 1)
+            assertEquals(
+                ComponentConfigSnapshotsExecutor.OUTPUT_STATUS_ERROR.asJsonPrimitive(),
+                bluePrintRuntimeService.getNodeTemplateAttributeValue(
+                    nodeTemplateName,
+                    ComponentConfigSnapshotsExecutor.OUTPUT_STATUS
+                )
+            )
             val msg = "Operation parameter must be fetch, store or diff"
-            assertEquals(msg.asJsonPrimitive(),
-                    bluePrintRuntimeService.getNodeTemplateAttributeValue(nodeTemplateName,
-                            ComponentConfigSnapshotsExecutor.OUTPUT_MESSAGE))
+            assertEquals(
+                msg.asJsonPrimitive(),
+                bluePrintRuntimeService.getNodeTemplateAttributeValue(
+                    nodeTemplateName,
+                    ComponentConfigSnapshotsExecutor.OUTPUT_MESSAGE
+                )
+            )
         }
     }
 
@@ -235,25 +274,34 @@ class ComponentConfigSnapshotsExecutorTest {
             try {
                 val resId = "121111"
                 val resType = "PNF"
-                cfgSnapshotService.write("snapshotConfig", resId, resType,  ResourceConfigSnapshot.Status.CANDIDATE)
-                prepareRequestProperties(OPERATION_DIFF, resId,  resType, "YANG")
+                cfgSnapshotService.write("snapshotConfig", resId, resType, ResourceConfigSnapshot.Status.CANDIDATE)
+                prepareRequestProperties(OPERATION_DIFF, resId, resType, "YANG")
 
                 cfgSnapshotComponent.processNB(executionRequest)
-
             } catch (e: BluePrintProcessorException) {
-                kotlin.test.assertEquals("Can't proceed with the cfg snapshot lookup: provide resource-id and resource-type.",
-                        e.message)
+                kotlin.test.assertEquals(
+                    "Can't proceed with the cfg snapshot lookup: provide resource-id and resource-type.",
+                    e.message
+                )
                 return@runBlocking
             }
 
             // then; we should get error in our output properties
-            assertEquals(ComponentConfigSnapshotsExecutor.OUTPUT_STATUS_ERROR.asJsonPrimitive(),
-                    bluePrintRuntimeService.getNodeTemplateAttributeValue(nodeTemplateName,
-                            ComponentConfigSnapshotsExecutor.OUTPUT_STATUS))
+            assertEquals(
+                ComponentConfigSnapshotsExecutor.OUTPUT_STATUS_ERROR.asJsonPrimitive(),
+                bluePrintRuntimeService.getNodeTemplateAttributeValue(
+                    nodeTemplateName,
+                    ComponentConfigSnapshotsExecutor.OUTPUT_STATUS
+                )
+            )
             val message = "Could not compare config snapshots for type YANG"
-            assertEquals(message.asJsonPrimitive(),
-                    bluePrintRuntimeService.getNodeTemplateAttributeValue(nodeTemplateName,
-                            ComponentConfigSnapshotsExecutor.OUTPUT_MESSAGE))
+            assertEquals(
+                message.asJsonPrimitive(),
+                bluePrintRuntimeService.getNodeTemplateAttributeValue(
+                    nodeTemplateName,
+                    ComponentConfigSnapshotsExecutor.OUTPUT_MESSAGE
+                )
+            )
         }
     }
 
@@ -271,27 +319,37 @@ class ComponentConfigSnapshotsExecutorTest {
 
                 prepareRequestProperties(OPERATION_DIFF, resId, resType, DIFF_JSON)
                 cfgSnapshotComponent.processNB(executionRequest)
-
             } catch (e: BluePrintProcessorException) {
-                kotlin.test.assertEquals("Can't proceed with the cfg snapshot diff: provide resource-id and resource-type.",
-                        e.message)
+                kotlin.test.assertEquals(
+                    "Can't proceed with the cfg snapshot diff: provide resource-id and resource-type.",
+                    e.message
+                )
                 return@runBlocking
             }
 
             // then; we should get success
-            assertTrue( bluePrintRuntimeService.getBluePrintError().errors.size == 0 )
-            assertEquals(ComponentConfigSnapshotsExecutor.OUTPUT_STATUS_SUCCESS.asJsonPrimitive(),
-                    bluePrintRuntimeService.getNodeTemplateAttributeValue(nodeTemplateName,
-                            ComponentConfigSnapshotsExecutor.OUTPUT_STATUS))
+            assertTrue(bluePrintRuntimeService.getBluePrintError().errors.size == 0)
+            assertEquals(
+                ComponentConfigSnapshotsExecutor.OUTPUT_STATUS_SUCCESS.asJsonPrimitive(),
+                bluePrintRuntimeService.getNodeTemplateAttributeValue(
+                    nodeTemplateName,
+                    ComponentConfigSnapshotsExecutor.OUTPUT_STATUS
+                )
+            )
 
             // then; we should get JSON-patches differences in our response property
-            val diffJson = "[{\"op\":\"add\",\"path\":\"/system-uptime-information/last-configured-time/new-child-object\",\"value\":{\"property\":\"value\"}}," +
+            val diffJson =
+                "[{\"op\":\"add\",\"path\":\"/system-uptime-information/last-configured-time/new-child-object\",\"value\":{\"property\":\"value\"}}," +
                     "{\"op\":\"replace\",\"path\":\"/system-uptime-information/system-booted-time/time-length\",\"value\":\"14:52:54\"}," +
                     "{\"op\":\"replace\",\"path\":\"/system-uptime-information/time-source\",\"value\":\" DNS CLOCK \"}," +
                     "{\"op\":\"add\",\"path\":\"/system-uptime-information/uptime-information/load-average-10\",\"value\":\"0.05\"}]"
-            assertEquals(diffJson.asJsonPrimitive(),
-                    bluePrintRuntimeService.getNodeTemplateAttributeValue(nodeTemplateName,
-                            ComponentConfigSnapshotsExecutor.OUTPUT_SNAPSHOT))
+            assertEquals(
+                diffJson.asJsonPrimitive(),
+                bluePrintRuntimeService.getNodeTemplateAttributeValue(
+                    nodeTemplateName,
+                    ComponentConfigSnapshotsExecutor.OUTPUT_SNAPSHOT
+                )
+            )
         }
     }
 
@@ -310,57 +368,84 @@ class ComponentConfigSnapshotsExecutorTest {
                 prepareRequestProperties(OPERATION_DIFF, resId, resType, DIFF_XML)
 
                 cfgSnapshotComponent.processNB(executionRequest)
-
             } catch (e: BluePrintProcessorException) {
-                kotlin.test.assertEquals("Can't proceed with the cfg snapshot diff: provide resource-id and resource-type.",
-                        e.message)
+                kotlin.test.assertEquals(
+                    "Can't proceed with the cfg snapshot diff: provide resource-id and resource-type.",
+                    e.message
+                )
                 return@runBlocking
             }
 
             // then; we should get success
-            assertTrue( bluePrintRuntimeService.getBluePrintError().errors.size == 0 )
-            assertEquals(ComponentConfigSnapshotsExecutor.OUTPUT_STATUS_SUCCESS.asJsonPrimitive(),
-                    bluePrintRuntimeService.getNodeTemplateAttributeValue(nodeTemplateName,
-                            ComponentConfigSnapshotsExecutor.OUTPUT_STATUS))
+            assertTrue(bluePrintRuntimeService.getBluePrintError().errors.size == 0)
+            assertEquals(
+                ComponentConfigSnapshotsExecutor.OUTPUT_STATUS_SUCCESS.asJsonPrimitive(),
+                bluePrintRuntimeService.getNodeTemplateAttributeValue(
+                    nodeTemplateName,
+                    ComponentConfigSnapshotsExecutor.OUTPUT_STATUS
+                )
+            )
 
             // then; we should get XML-patches differences in our response property
             val diffXml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
-                    "<diff>" +
-                    "<replace sel=\"/output[1]/interface-information[1]/interface-flapped[1]/@seconds\">2343</replace>" +
-                    "<replace sel=\"/output[1]/interface-information[1]/interface-flapped[1]/text()[1]\">34</replace>" +
-                    "<replace sel=\"/output[1]/interface-information[1]/traffic-statistics[1]/input-packets[1]/text()[1]\">09098789</replace>" +
-                    "<replace sel=\"/output[1]/interface-information[1]/traffic-statistics[1]/output-packets[1]/text()[1]\">2828828</replace>" +
-                    "<add sel=\"/output[1]/interface-information[1]/physical-interface[1]\"><interface-name>TEGig400-int01</interface-name></add>" +
-                    "</diff>"
-            assertEquals(diffXml.asJsonPrimitive(),
-                    bluePrintRuntimeService.getNodeTemplateAttributeValue(nodeTemplateName,
-                            ComponentConfigSnapshotsExecutor.OUTPUT_SNAPSHOT))        }
+                "<diff>" +
+                "<replace sel=\"/output[1]/interface-information[1]/interface-flapped[1]/@seconds\">2343</replace>" +
+                "<replace sel=\"/output[1]/interface-information[1]/interface-flapped[1]/text()[1]\">34</replace>" +
+                "<replace sel=\"/output[1]/interface-information[1]/traffic-statistics[1]/input-packets[1]/text()[1]\">09098789</replace>" +
+                "<replace sel=\"/output[1]/interface-information[1]/traffic-statistics[1]/output-packets[1]/text()[1]\">2828828</replace>" +
+                "<add sel=\"/output[1]/interface-information[1]/physical-interface[1]\"><interface-name>TEGig400-int01</interface-name></add>" +
+                "</diff>"
+            assertEquals(
+                diffXml.asJsonPrimitive(),
+                bluePrintRuntimeService.getNodeTemplateAttributeValue(
+                    nodeTemplateName,
+                    ComponentConfigSnapshotsExecutor.OUTPUT_SNAPSHOT
+                )
+            )
+        }
     }
 
-    private fun preparePayload(filename : String, resId : String, resType : String, status: ResourceConfigSnapshot.Status) {
+    private fun preparePayload(
+        filename: String,
+        resId: String,
+        resType: String,
+        status: ResourceConfigSnapshot.Status
+    ) {
         runBlocking {
-            cfgSnapshotService.write(JacksonUtils.getClassPathFileContent("payload/requests/$filename"), resId, resType, status)
+            cfgSnapshotService.write(
+                JacksonUtils.getClassPathFileContent("payload/requests/$filename"),
+                resId,
+                resType,
+                status
+            )
         }
     }
 
-    private fun prepareRequestProperties (oper : String, resId : String, resType : String, optional: String = "") {
+    private fun prepareRequestProperties(oper: String, resId: String, resType: String, optional: String = "") {
         cfgSnapshotComponent.operationInputs[ComponentConfigSnapshotsExecutor.INPUT_OPERATION] = oper.asJsonPrimitive()
-        cfgSnapshotComponent.operationInputs[ComponentConfigSnapshotsExecutor.INPUT_RESOURCE_ID] = resId.asJsonPrimitive()
-        cfgSnapshotComponent.operationInputs[ComponentConfigSnapshotsExecutor.INPUT_RESOURCE_TYPE] = resType.asJsonPrimitive()
+        cfgSnapshotComponent.operationInputs[ComponentConfigSnapshotsExecutor.INPUT_RESOURCE_ID] =
+            resId.asJsonPrimitive()
+        cfgSnapshotComponent.operationInputs[ComponentConfigSnapshotsExecutor.INPUT_RESOURCE_TYPE] =
+            resType.asJsonPrimitive()
 
         // Optional inputs
-        cfgSnapshotComponent.operationInputs[ComponentConfigSnapshotsExecutor.INPUT_DIFF_CONTENT_TYPE] = "".asJsonPrimitive()
-        cfgSnapshotComponent.operationInputs[ComponentConfigSnapshotsExecutor.INPUT_RESOURCE_SNAPSHOT] = "".asJsonPrimitive()
+        cfgSnapshotComponent.operationInputs[ComponentConfigSnapshotsExecutor.INPUT_DIFF_CONTENT_TYPE] =
+            "".asJsonPrimitive()
+        cfgSnapshotComponent.operationInputs[ComponentConfigSnapshotsExecutor.INPUT_RESOURCE_SNAPSHOT] =
+            "".asJsonPrimitive()
         cfgSnapshotComponent.operationInputs[ComponentConfigSnapshotsExecutor.INPUT_RESOURCE_STATUS] =
-                ResourceConfigSnapshot.Status.RUNNING.name.asJsonPrimitive()
+            ResourceConfigSnapshot.Status.RUNNING.name.asJsonPrimitive()
 
         when (oper) {
             OPERATION_DIFF ->
-                cfgSnapshotComponent.operationInputs[ComponentConfigSnapshotsExecutor.INPUT_DIFF_CONTENT_TYPE] = optional.asJsonPrimitive()
+                cfgSnapshotComponent.operationInputs[ComponentConfigSnapshotsExecutor.INPUT_DIFF_CONTENT_TYPE] =
+                    optional.asJsonPrimitive()
             OPERATION_STORE ->
-                cfgSnapshotComponent.operationInputs[ComponentConfigSnapshotsExecutor.INPUT_RESOURCE_SNAPSHOT] = optional.asJsonPrimitive()
+                cfgSnapshotComponent.operationInputs[ComponentConfigSnapshotsExecutor.INPUT_RESOURCE_SNAPSHOT] =
+                    optional.asJsonPrimitive()
             OPERATION_FETCH ->
-                cfgSnapshotComponent.operationInputs[ComponentConfigSnapshotsExecutor.INPUT_RESOURCE_STATUS] = optional.asJsonPrimitive()
+                cfgSnapshotComponent.operationInputs[ComponentConfigSnapshotsExecutor.INPUT_RESOURCE_STATUS] =
+                    optional.asJsonPrimitive()
         }
     }
 }