From 7f6309474225cbd0da8d8ed010bbd50f2c70c24b Mon Sep 17 00:00:00 2001 From: "adheli.tavares" Date: Wed, 9 Mar 2022 10:39:29 +0000 Subject: [PATCH] Clean up of unit tests for ACM definitions Issue-ID: POLICY-3945 Change-Id: I080e402899d2b2960b46efa06db68041a73f5d2b Signed-off-by: adheli.tavares --- .../clamp/acm/gentleguidance/sampleAcmTosca.yml | 255 +- .../clamp/acm/pmsh/funtional-pmsh-usecase.yaml | 134 +- .../clamp/acm/test}/pmsh_multiple_ac_tosca.yaml | 12 +- runtime-acm/pom.xml | 24 +- .../commissioning/CommissioningProviderTest.java | 21 +- .../rest/CommissioningControllerTest.java | 33 +- .../messaging/MessageDispatcherActivatorTest.java | 6 +- ...mationCompositionInstantiationProviderTest.java | 34 +- .../runtime/instantiation/InstantiationUtils.java | 6 +- .../rest/InstantiationControllerTest.java | 17 +- .../runtime/main/rest/ActuatorControllerTest.java | 6 +- .../runtime/monitoring/TestMonitoringProvider.java | 31 +- .../rest/MonitoringQueryControllerTest.java | 8 +- .../acm/runtime/supervision/HandleCounterTest.java | 5 +- .../supervision/SupervisionHandlerTest.java | 18 +- .../supervision/SupervisionScannerTest.java | 13 +- .../clamp/acm/runtime/util/CommonTestData.java | 26 +- .../src/test/resources/application-test.yaml | 36 + .../src/test/resources/application_test.properties | 37 - .../full-tosca-with-common-properties.yaml | 3546 -------------------- .../pm_automation_composition_tosca.yaml | 452 --- .../servicetemplates/tosca-for-smoke-testing.yaml | 3488 ------------------- 22 files changed, 350 insertions(+), 7858 deletions(-) rename {runtime-acm/src/test/resources/rest/servicetemplates => examples/src/main/resources/clamp/acm/test}/pmsh_multiple_ac_tosca.yaml (95%) create mode 100644 runtime-acm/src/test/resources/application-test.yaml delete mode 100644 runtime-acm/src/test/resources/application_test.properties delete mode 100644 runtime-acm/src/test/resources/rest/servicetemplates/full-tosca-with-common-properties.yaml delete mode 100644 runtime-acm/src/test/resources/rest/servicetemplates/pm_automation_composition_tosca.yaml delete mode 100644 runtime-acm/src/test/resources/rest/servicetemplates/tosca-for-smoke-testing.yaml diff --git a/examples/src/main/resources/clamp/acm/gentleguidance/sampleAcmTosca.yml b/examples/src/main/resources/clamp/acm/gentleguidance/sampleAcmTosca.yml index f1675caa0..bd7242fe5 100644 --- a/examples/src/main/resources/clamp/acm/gentleguidance/sampleAcmTosca.yml +++ b/examples/src/main/resources/clamp/acm/gentleguidance/sampleAcmTosca.yml @@ -33,7 +33,7 @@ data_types: derived_from: tosca.datatypes.Root properties: restRequestId: - type: onap.datatypes.ToscaConceptIdentifier + type: onap.datatypes.ToscaConceptIdentifier typeVersion: 1.0.0 required: true description: The name and version of a REST request to be sent to a REST endpoint @@ -41,7 +41,7 @@ data_types: type: string required: true constraints: - - valid_values: [POST, PUT, GET, DELETE] + - valid_values: [ POST, PUT, GET, DELETE ] description: The REST method to use path: type: string @@ -54,139 +54,139 @@ data_types: expectedResponse: type: integer required: true - constraints: [] + constraints: [ ] description: THe expected HTTP status code for the REST request org.onap.datatypes.policy.clamp.acm.httpAutomationCompositionElement.ConfigurationEntity: - version: 1.0.0 - derived_from: tosca.datatypes.Root - properties: - configurationEntityId: - type: onap.datatypes.ToscaConceptIdentifier - typeVersion: 1.0.0 - required: true - description: The name and version of a Configuration Entity to be handled by the HTTP Automation Composition Element - restSequence: - type: list - entry_schema: - type: org.onap.datatypes.policy.clamp.acm.httpAutomationCompositionElement.RestRequest - typeVersion: 1.0.0 - description: A sequence of REST commands to send to the REST endpoint - - node_types: - org.onap.policy.clamp.acm.Participant: - version: 1.0.1 - derived_from: tosca.nodetypes.Root - properties: - provider: - type: string - requred: false - org.onap.policy.clamp.acm.AutomationCompositionElement: - version: 1.0.1 - derived_from: tosca.nodetypes.Root + version: 1.0.0 + derived_from: tosca.datatypes.Root properties: - provider: - type: string - required: false - metadata: - common: true - description: Specifies the organization that provides the automation composition element - participant_id: - type: onap.datatypes.ToscaConceptIdentifier - requred: true - metadata: - common: true - participantType: + configurationEntityId: type: onap.datatypes.ToscaConceptIdentifier + typeVersion: 1.0.0 required: true - metadata: - common: true - description: The identity of the participant type that hosts this type of Automation Composition Element - startPhase: - type: integer - required: false - constraints: - - greater_or_equal: 0 - metadata: - common: true - description: A value indicating the start phase in which this automation composition element will be started, the - first start phase is zero. Automation Composition Elements are started in their start_phase order and stopped - in reverse start phase order. Automation Composition Elements with the same start phase are started and - stopped simultaneously - uninitializedToPassiveTimeout: - type: integer - required: false - constraints: - - greater_or_equal: 0 - default: 60 - metadata: - common: true - description: The maximum time in seconds to wait for a state chage from uninitialized to passive - passiveToRunningTimeout: - type: integer - required: false - constraints: - - greater_or_equal: 0 - default: 60 - metadata: - common: true - description: The maximum time in seconds to wait for a state chage from passive to running - runningToPassiveTimeout: - type: integer - required: false - constraints: - - greater_or_equal: 0 - default: 60 - metadata: - common: true - description: The maximum time in seconds to wait for a state chage from running to passive - passiveToUninitializedTimeout: - type: integer - required: false - constraints: - - greater_or_equal: 0 - default: 60 - metadata: - common: true - description: The maximum time in seconds to wait for a state chage from passive to uninitialized - org.onap.policy.clamp.acm.AutomationComposition: - version: 1.0.1 - derived_from: tosca.nodetypes.Root - properties: - provider: - type: string - required: false - metadata: - common: true - description: Specifies the organization that provides the automation composition element - elements: + description: The name and version of a Configuration Entity to be handled by the HTTP Automation Composition Element + restSequence: type: list - required: true - metadata: - common: true entry_schema: + type: org.onap.datatypes.policy.clamp.acm.httpAutomationCompositionElement.RestRequest + typeVersion: 1.0.0 + description: A sequence of REST commands to send to the REST endpoint + + node_types: + org.onap.policy.clamp.acm.Participant: + version: 1.0.1 + derived_from: tosca.nodetypes.Root + properties: + provider: + type: string + requred: false + org.onap.policy.clamp.acm.AutomationCompositionElement: + version: 1.0.1 + derived_from: tosca.nodetypes.Root + properties: + provider: + type: string + required: false + metadata: + common: true + description: Specifies the organization that provides the automation composition element + participant_id: type: onap.datatypes.ToscaConceptIdentifier - description: Specifies a list of automation composition element definitions that make up this automation composition definition - org.onap.policy.clamp.acm.HttpAutomationCompositionElement: - version: 1.0.1 - derived_from: org.onap.policy.clamp.acm.AutomationCompositionElement - properties: - baseUrl: - type: string - required: true - description: The base URL to be prepended to each path, identifies the host for the REST endpoints. - httpHeaders: - type: map - required: false - entry_schema: + requred: true + metadata: + common: true + participantType: + type: onap.datatypes.ToscaConceptIdentifier + required: true + metadata: + common: true + description: The identity of the participant type that hosts this type of Automation Composition Element + startPhase: + type: integer + required: false + constraints: + - greater_or_equal: 0 + metadata: + common: true + description: A value indicating the start phase in which this automation composition element will be started, the + first start phase is zero. Automation Composition Elements are started in their start_phase order and stopped + in reverse start phase order. Automation Composition Elements with the same start phase are started and + stopped simultaneously + uninitializedToPassiveTimeout: + type: integer + required: false + constraints: + - greater_or_equal: 0 + default: 60 + metadata: + common: true + description: The maximum time in seconds to wait for a state chage from uninitialized to passive + passiveToRunningTimeout: + type: integer + required: false + constraints: + - greater_or_equal: 0 + default: 60 + metadata: + common: true + description: The maximum time in seconds to wait for a state chage from passive to running + runningToPassiveTimeout: + type: integer + required: false + constraints: + - greater_or_equal: 0 + default: 60 + metadata: + common: true + description: The maximum time in seconds to wait for a state chage from running to passive + passiveToUninitializedTimeout: + type: integer + required: false + constraints: + - greater_or_equal: 0 + default: 60 + metadata: + common: true + description: The maximum time in seconds to wait for a state chage from passive to uninitialized + org.onap.policy.clamp.acm.AutomationComposition: + version: 1.0.1 + derived_from: tosca.nodetypes.Root + properties: + provider: type: string - description: HTTP headers to send on REST requests - configurationEntities: - type: map - required: true - entry_schema: - type: org.onap.datatypes.policy.clamp.acm.httpAutomationCompositionElement.ConfigurationEntity - typeVersion: 1.0.0 - description: The connfiguration entities the Automation Composition Element is managing and their associated REST requests + required: false + metadata: + common: true + description: Specifies the organization that provides the automation composition element + elements: + type: list + required: true + metadata: + common: true + entry_schema: + type: onap.datatypes.ToscaConceptIdentifier + description: Specifies a list of automation composition element definitions that make up this automation composition definition + org.onap.policy.clamp.acm.HttpAutomationCompositionElement: + version: 1.0.1 + derived_from: org.onap.policy.clamp.acm.AutomationCompositionElement + properties: + baseUrl: + type: string + required: true + description: The base URL to be prepended to each path, identifies the host for the REST endpoints. + httpHeaders: + type: map + required: false + entry_schema: + type: string + description: HTTP headers to send on REST requests + configurationEntities: + type: map + required: true + entry_schema: + type: org.onap.datatypes.policy.clamp.acm.httpAutomationCompositionElement.ConfigurationEntity + typeVersion: 1.0.0 + description: The connfiguration entities the Automation Composition Element is managing and their associated REST requests topology_template: node_templates: @@ -240,7 +240,6 @@ topology_template: description: Automation composition for executing simple http requests properties: provider: ONAP - elements: + elements: - name: org.onap.policy.clamp.Http_AutomationCompositionElement version: 1.2.3 - \ No newline at end of file diff --git a/examples/src/main/resources/clamp/acm/pmsh/funtional-pmsh-usecase.yaml b/examples/src/main/resources/clamp/acm/pmsh/funtional-pmsh-usecase.yaml index e61fc25b4..8df3a4e7e 100644 --- a/examples/src/main/resources/clamp/acm/pmsh/funtional-pmsh-usecase.yaml +++ b/examples/src/main/resources/clamp/acm/pmsh/funtional-pmsh-usecase.yaml @@ -134,7 +134,7 @@ data_types: required: false default: final_failure_guard onap.datatypes.monitoring.managedObjectDNsBasic: - constraints: [] + constraints: [ ] properties: DN: name: DN @@ -142,14 +142,14 @@ data_types: typeVersion: 0.0.0 description: Managed object distinguished name required: true - constraints: [] - metadata: {} + constraints: [ ] + metadata: { } name: onap.datatypes.monitoring.managedObjectDNsBasic version: 0.0.0 derived_from: tosca.datatypes.Root - metadata: {} + metadata: { } onap.datatypes.monitoring.managedObjectDNsBasics: - constraints: [] + constraints: [ ] properties: managedObjectDNsBasic: name: managedObjectDNsBasic @@ -157,18 +157,18 @@ data_types: typeVersion: 0.0.0 description: Managed object distinguished name object required: true - constraints: [] + constraints: [ ] entry_schema: type: onap.datatypes.monitoring.managedObjectDNsBasic typeVersion: 0.0.0 - constraints: [] - metadata: {} + constraints: [ ] + metadata: { } name: onap.datatypes.monitoring.managedObjectDNsBasics version: 0.0.0 derived_from: tosca.datatypes.Root - metadata: {} + metadata: { } onap.datatypes.monitoring.measurementGroup: - constraints: [] + constraints: [ ] properties: measurementTypes: name: measurementTypes @@ -176,30 +176,30 @@ data_types: typeVersion: 0.0.0 description: List of measurement types required: true - constraints: [] + constraints: [ ] entry_schema: type: onap.datatypes.monitoring.measurementTypes typeVersion: 0.0.0 - constraints: [] - metadata: {} + constraints: [ ] + metadata: { } managedObjectDNsBasic: name: managedObjectDNsBasic type: list typeVersion: 0.0.0 description: List of managed object distinguished names required: true - constraints: [] + constraints: [ ] entry_schema: type: onap.datatypes.monitoring.managedObjectDNsBasics typeVersion: 0.0.0 - constraints: [] - metadata: {} + constraints: [ ] + metadata: { } name: onap.datatypes.monitoring.measurementGroup version: 0.0.0 derived_from: tosca.datatypes.Root - metadata: {} + metadata: { } onap.datatypes.monitoring.measurementGroups: - constraints: [] + constraints: [ ] properties: measurementGroup: name: measurementGroup @@ -207,18 +207,18 @@ data_types: typeVersion: 0.0.0 description: Measurement Group required: true - constraints: [] + constraints: [ ] entry_schema: type: onap.datatypes.monitoring.measurementGroup typeVersion: 0.0.0 - constraints: [] - metadata: {} + constraints: [ ] + metadata: { } name: onap.datatypes.monitoring.measurementGroups version: 0.0.0 derived_from: tosca.datatypes.Root - metadata: {} + metadata: { } onap.datatypes.monitoring.measurementType: - constraints: [] + constraints: [ ] properties: measurementType: name: measurementType @@ -226,14 +226,14 @@ data_types: typeVersion: 0.0.0 description: Measurement type required: true - constraints: [] - metadata: {} + constraints: [ ] + metadata: { } name: onap.datatypes.monitoring.measurementType version: 0.0.0 derived_from: tosca.datatypes.Root - metadata: {} + metadata: { } onap.datatypes.monitoring.measurementTypes: - constraints: [] + constraints: [ ] properties: measurementType: name: measurementType @@ -241,18 +241,18 @@ data_types: typeVersion: 0.0.0 description: Measurement type object required: true - constraints: [] + constraints: [ ] entry_schema: type: onap.datatypes.monitoring.measurementType typeVersion: 0.0.0 - constraints: [] - metadata: {} + constraints: [ ] + metadata: { } name: onap.datatypes.monitoring.measurementTypes version: 0.0.0 derived_from: tosca.datatypes.Root - metadata: {} + metadata: { } onap.datatypes.monitoring.nfFilter: - constraints: [] + constraints: [ ] properties: modelNames: name: modelNames @@ -260,54 +260,54 @@ data_types: typeVersion: 0.0.0 description: List of model names required: true - constraints: [] + constraints: [ ] entry_schema: type: string typeVersion: 0.0.0 - constraints: [] - metadata: {} + constraints: [ ] + metadata: { } modelInvariantIDs: name: modelInvariantIDs type: list typeVersion: 0.0.0 description: List of model invariant IDs required: true - constraints: [] + constraints: [ ] entry_schema: type: string typeVersion: 0.0.0 - constraints: [] - metadata: {} + constraints: [ ] + metadata: { } modelVersionIDs: name: modelVersionIDs type: list typeVersion: 0.0.0 description: List of model version IDs required: true - constraints: [] + constraints: [ ] entry_schema: type: string typeVersion: 0.0.0 - constraints: [] - metadata: {} + constraints: [ ] + metadata: { } nfNames: name: nfNames type: list typeVersion: 0.0.0 description: List of network functions required: true - constraints: [] + constraints: [ ] entry_schema: type: string typeVersion: 0.0.0 - constraints: [] - metadata: {} + constraints: [ ] + metadata: { } name: onap.datatypes.monitoring.nfFilter version: 0.0.0 derived_from: tosca.datatypes.Root - metadata: {} + metadata: { } onap.datatypes.monitoring.subscription: - constraints: [] + constraints: [ ] properties: measurementGroups: name: measurementGroups @@ -315,36 +315,36 @@ data_types: typeVersion: 0.0.0 description: Measurement Groups required: true - constraints: [] + constraints: [ ] entry_schema: type: onap.datatypes.monitoring.measurementGroups typeVersion: 0.0.0 - constraints: [] - metadata: {} + constraints: [ ] + metadata: { } fileBasedGP: name: fileBasedGP type: integer typeVersion: 0.0.0 description: File based granularity period required: true - constraints: [] - metadata: {} + constraints: [ ] + metadata: { } fileLocation: name: fileLocation type: string typeVersion: 0.0.0 description: ROP file location required: true - constraints: [] - metadata: {} + constraints: [ ] + metadata: { } subscriptionName: name: subscriptionName type: string typeVersion: 0.0.0 description: Name of the subscription required: true - constraints: [] - metadata: {} + constraints: [ ] + metadata: { } administrativeState: name: administrativeState type: string @@ -355,29 +355,29 @@ data_types: - valid_values: - LOCKED - UNLOCKED - metadata: {} + metadata: { } nfFilter: name: nfFilter type: map typeVersion: 0.0.0 description: Network function filter required: true - constraints: [] + constraints: [ ] entry_schema: type: onap.datatypes.monitoring.nfFilter typeVersion: 0.0.0 - constraints: [] - metadata: {} + constraints: [ ] + metadata: { } name: onap.datatypes.monitoring.subscription version: 0.0.0 derived_from: tosca.datatypes.Root - metadata: {} + metadata: { } org.onap.datatypes.policy.clamp.acm.httpAutomationCompositionElement.RestRequest: version: 1.0.0 derived_from: tosca.datatypes.Root properties: restRequestId: - type: onap.datatypes.ToscaConceptIdentifier + type: onap.datatypes.ToscaConceptIdentifier typeVersion: 1.0.0 required: true description: The name and version of a REST request to be sent to a REST endpoint @@ -385,7 +385,7 @@ data_types: type: string required: true constraints: - - valid_values: [POST, PUT, GET, DELETE] + - valid_values: [ POST, PUT, GET, DELETE ] description: The REST method to use path: type: string @@ -398,14 +398,14 @@ data_types: expectedResponse: type: integer required: true - constraints: [] + constraints: [ ] description: THe expected HTTP status code for the REST request org.onap.datatypes.policy.clamp.acm.httpAutomationCompositionElement.ConfigurationEntity: version: 1.0.0 derived_from: tosca.datatypes.Root properties: configurationEntityId: - type: onap.datatypes.ToscaConceptIdentifier + type: onap.datatypes.ToscaConceptIdentifier typeVersion: 1.0.0 required: true description: The name and version of a Configuration Entity to be handled by the HTTP Automation Composition Element @@ -434,12 +434,12 @@ policy_types: typeVersion: 0.0.0 description: PMSH Policy JSON required: false - constraints: [] - metadata: {} + constraints: [ ] + metadata: { } name: onap.policies.monitoring.dcae-pm-subscription-handler version: 1.0.0 derived_from: onap.policies.Monitoring - metadata: {} + metadata: { } onap.policies.acm.operational.Common: derived_from: tosca.policies.Root version: 1.0.0 diff --git a/runtime-acm/src/test/resources/rest/servicetemplates/pmsh_multiple_ac_tosca.yaml b/examples/src/main/resources/clamp/acm/test/pmsh_multiple_ac_tosca.yaml similarity index 95% rename from runtime-acm/src/test/resources/rest/servicetemplates/pmsh_multiple_ac_tosca.yaml rename to examples/src/main/resources/clamp/acm/test/pmsh_multiple_ac_tosca.yaml index 2a85a5ffa..a7a6bd262 100644 --- a/runtime-acm/src/test/resources/rest/servicetemplates/pmsh_multiple_ac_tosca.yaml +++ b/examples/src/main/resources/clamp/acm/test/pmsh_multiple_ac_tosca.yaml @@ -32,13 +32,13 @@ node_types: type: integer required: false constraints: - - greater-or-equal: 0 + - greater-or-equal: 0 metadata: - common: true - description: A value indicating the start phase in which this automation composition element will be started, the - first start phase is zero. Automation Composition Elements are started in their start_phase order and stopped - in reverse start phase order. Automation Composition Elements with the same start phase are started and - stopped simultaneously + common: true + description: A value indicating the start phase in which this automation composition element will be started, + the first start phase is zero. Automation Composition Elements are started in their start_phase order and + stopped in reverse start phase order. Automation Composition Elements with the same start phase are started + and stopped simultaneously org.onap.policy.clamp.acm.AutomationComposition: version: 1.0.1 derived_from: tosca.nodetypes.Root diff --git a/runtime-acm/pom.xml b/runtime-acm/pom.xml index 7712d8235..333a75dc2 100644 --- a/runtime-acm/pom.xml +++ b/runtime-acm/pom.xml @@ -1,7 +1,7 @@