aboutsummaryrefslogtreecommitdiffstats
path: root/runtime-acm/src/main/resources
diff options
context:
space:
mode:
authorlapentafd <francesco.lapenta@est.tech>2022-12-12 14:28:41 +0000
committerlapentafd <francesco.lapenta@est.tech>2022-12-14 10:13:06 +0000
commitc92368c89f334c3a6a84c3c67aea05dce1db66f8 (patch)
tree6b37b335ffd57baa200b37e801a209d87a4d1ceb /runtime-acm/src/main/resources
parent06d4bbe578678619be4d948fde42223719e82cf1 (diff)
Server stubs for acm runtime
- Added spring profile "stub" - Added Commission and Instantiation stub controllers - Added util function that decodes the object from the openapi/examples - Added 2 missing examples - Added Unit Test for stub controllers Issue-ID: POLICY-4143 Change-Id: Ife91a74e93df4e9db55e17ca9d1793a7ed289e92 Signed-off-by: lapentafd <francesco.lapenta@est.tech>
Diffstat (limited to 'runtime-acm/src/main/resources')
-rw-r--r--runtime-acm/src/main/resources/application-stub.yaml21
-rw-r--r--runtime-acm/src/main/resources/application.yaml2
-rw-r--r--runtime-acm/src/main/resources/openapi/examples/getAllCompositionInstancesResponse.json72
-rw-r--r--runtime-acm/src/main/resources/openapi/examples/getAllCompositionInstancesResponse.yaml54
4 files changed, 149 insertions, 0 deletions
diff --git a/runtime-acm/src/main/resources/application-stub.yaml b/runtime-acm/src/main/resources/application-stub.yaml
new file mode 100644
index 000000000..e752df3fd
--- /dev/null
+++ b/runtime-acm/src/main/resources/application-stub.yaml
@@ -0,0 +1,21 @@
+spring:
+ application:
+ name: "policy-clamp-runtime-acm-stub"
+stub:
+ deleteCompositionDefinitionResponse: "/openapi/examples/deleteCompositionDefinitionResponse.json"
+ deleteCompositionInstanceResponse: "/openapi/examples/deleteCompositionInstanceResponse.json"
+ getAllCompositionDefinitions: "/openapi/examples/getAllCompositionDefinitions.json"
+ getAllCompositionInstancesResponse: "/openapi/examples/getAllCompositionInstancesResponse.json"
+ getCompositionInstancesResponse: "/openapi/examples/getCompositionInstancesResponse.json"
+ getSingleCompositionDefinition: "/openapi/examples/getSingleCompositionDefinition.json"
+ postCommissionResponse: "/openapi/examples/postCommissionCompositionDefinitionsResponse.json"
+ postCompositionDefinitions: "/openapi/examples/postCompositionDefinitions.json"
+ postCompositionInstance: "/openapi/examples/postCompositionInstance.json"
+ postInstanceResponse: "/openapi/examples/postCompositionInstancesResponse.json"
+ putCompositionDefinitionUpdate: "/openapi/examples/putCompositionDefinitionUpdate.json"
+ putCompositionDefinitionUpdateResponse: "/openapi/examples/putCompositionDefinitionUpdateResponse.json"
+ putCompositionInstanceUpdate: "/openapi/examples/putCompositionInstanceUpdate.json"
+ putCompositionInstanceUpdateResponse: " /openapi/examples/putCompositionInstanceUpdateResponse.json"
+
+
+
diff --git a/runtime-acm/src/main/resources/application.yaml b/runtime-acm/src/main/resources/application.yaml
index df1310d0a..771d7006a 100644
--- a/runtime-acm/src/main/resources/application.yaml
+++ b/runtime-acm/src/main/resources/application.yaml
@@ -1,4 +1,6 @@
spring:
+ profiles:
+ active: default
security:
user:
name: runtimeUser
diff --git a/runtime-acm/src/main/resources/openapi/examples/getAllCompositionInstancesResponse.json b/runtime-acm/src/main/resources/openapi/examples/getAllCompositionInstancesResponse.json
new file mode 100644
index 000000000..55b99b28c
--- /dev/null
+++ b/runtime-acm/src/main/resources/openapi/examples/getAllCompositionInstancesResponse.json
@@ -0,0 +1,72 @@
+{
+ "automationCompositionList": [
+ {
+ "compositionId": "562ed027-2689-481a-b3a5-e284b1fbc33f",
+ "state": "UNINITIALISED",
+ "orderedState": "UNINITIALISED",
+ "elements": {
+ "709c62b3-8918-41b9-a747-d21eb79c6c23": {
+ "id": "709c62b3-8918-41b9-a747-d21eb79c6c23",
+ "definition": {
+ "name": "onap.policy.clamp.ac.element.Http_SinkAutomationCompositionElement",
+ "version": "1.2.3"
+ },
+ "participantType": {
+ "name": "org.onap.policy.clamp.acm.HttpParticipant",
+ "version": "2.3.4"
+ },
+ "participantId": {
+ "name": "HttpParticipant0",
+ "version": "1.0.0"
+ },
+ "state": "UNINITIALISED",
+ "orderedState": "UNINITIALISED",
+ "description": "Sink Automation Composition Element for the Demo",
+ "propertiesMap": {}
+ },
+ "709c62b3-8918-41b9-a747-d21eb79c6c25": {
+ "id": "709c62b3-8918-41b9-a747-d21eb79c6c25",
+ "definition": {
+ "name": "onap.policy.clamp.ac.element.Http_BridgeAutomationCompositionElement",
+ "version": "1.2.3"
+ },
+ "participantType": {
+ "name": "org.onap.policy.clamp.acm.HttpParticipant",
+ "version": "2.3.4"
+ },
+ "participantId": {
+ "name": "HttpParticipant0",
+ "version": "1.0.0"
+ },
+ "state": "UNINITIALISED",
+ "orderedState": "UNINITIALISED",
+ "description": "Bridge Automation Composition Element for the Demo",
+ "propertiesMap": {}
+ },
+ "709c62b3-8918-41b9-a747-d21eb79c6c24": {
+ "id": "709c62b3-8918-41b9-a747-d21eb79c6c24",
+ "definition": {
+ "name": "onap.policy.clamp.ac.element.Http_StarterAutomationCompositionElement",
+ "version": "1.2.3"
+ },
+ "participantType": {
+ "name": "org.onap.policy.clamp.acm.HttpParticipant",
+ "version": "2.3.4"
+ },
+ "participantId": {
+ "name": "HttpParticipant0",
+ "version": "1.0.0"
+ },
+ "state": "UNINITIALISED",
+ "orderedState": "UNINITIALISED",
+ "description": "Starter Automation Composition Element for the Demo",
+ "propertiesMap": {}
+ }
+ },
+ "primed": false,
+ "name": "InstanceHttp",
+ "version": "1.0.1",
+ "description": "Demo automation composition instance Http"
+ }
+ ]
+} \ No newline at end of file
diff --git a/runtime-acm/src/main/resources/openapi/examples/getAllCompositionInstancesResponse.yaml b/runtime-acm/src/main/resources/openapi/examples/getAllCompositionInstancesResponse.yaml
new file mode 100644
index 000000000..3fa6506ea
--- /dev/null
+++ b/runtime-acm/src/main/resources/openapi/examples/getAllCompositionInstancesResponse.yaml
@@ -0,0 +1,54 @@
+automationCompositionList:
+- compositionId: 562ed027-2689-481a-b3a5-e284b1fbc33f
+ state: UNINITIALISED
+ orderedState: UNINITIALISED
+ elements:
+ 709c62b3-8918-41b9-a747-d21eb79c6c23:
+ id: 709c62b3-8918-41b9-a747-d21eb79c6c23
+ definition:
+ name: onap.policy.clamp.ac.element.Http_SinkAutomationCompositionElement
+ version: 1.2.3
+ participantType:
+ name: org.onap.policy.clamp.acm.HttpParticipant
+ version: 2.3.4
+ participantId:
+ name: HttpParticipant0
+ version: 1.0.0
+ state: UNINITIALISED
+ orderedState: UNINITIALISED
+ description: Sink Automation Composition Element for the Demo
+ propertiesMap: {}
+ 709c62b3-8918-41b9-a747-d21eb79c6c25:
+ id: 709c62b3-8918-41b9-a747-d21eb79c6c25
+ definition:
+ name: onap.policy.clamp.ac.element.Http_BridgeAutomationCompositionElement
+ version: 1.2.3
+ participantType:
+ name: org.onap.policy.clamp.acm.HttpParticipant
+ version: 2.3.4
+ participantId:
+ name: HttpParticipant0
+ version: 1.0.0
+ state: UNINITIALISED
+ orderedState: UNINITIALISED
+ description: Bridge Automation Composition Element for the Demo
+ propertiesMap: {}
+ 709c62b3-8918-41b9-a747-d21eb79c6c24:
+ id: 709c62b3-8918-41b9-a747-d21eb79c6c24
+ definition:
+ name: onap.policy.clamp.ac.element.Http_StarterAutomationCompositionElement
+ version: 1.2.3
+ participantType:
+ name: org.onap.policy.clamp.acm.HttpParticipant
+ version: 2.3.4
+ participantId:
+ name: HttpParticipant0
+ version: 1.0.0
+ state: UNINITIALISED
+ orderedState: UNINITIALISED
+ description: Starter Automation Composition Element for the Demo
+ propertiesMap: {}
+ primed: false
+ name: InstanceHttp
+ version: 1.0.1
+ description: Demo automation composition instance Http