Fix tca monitoring tca_policy type 18/103018/4
authorPamela Dragosh <pdragosh@research.att.com>
Wed, 4 Mar 2020 15:29:54 +0000 (10:29 -0500)
committerPamela Dragosh <pdragosh@research.att.com>
Wed, 4 Mar 2020 17:48:25 +0000 (12:48 -0500)
Should not use map or entry_schema

Issue-ID: POLICY-2408
Change-Id: Ieebe625676edab6c44323b7c69a50cc22099235f
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
models-examples/src/main/resources/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app.yaml
models-tosca/src/test/java/org/onap/policy/models/tosca/simple/serialization/MonitoringPolicyTypeSerializationTest.java

index 5fa4308..dc16da2 100644 (file)
@@ -9,10 +9,8 @@ policy_types:
       version: 1.0.0
       properties:
          tca_policy:
-            type: map
+            type: onap.datatypes.monitoring.tca_policy
             description: TCA Policy JSON
-            entry_schema:
-               type: onap.datatypes.monitoring.tca_policy
 data_types:
    onap.datatypes.monitoring.metricsPerEventName:
       derived_from: tosca.datatypes.Root
index 270bc6c..ef41230 100644 (file)
@@ -40,7 +40,6 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate;
 import org.onap.policy.models.tosca.simple.concepts.JpaToscaConstraintLogical;
 import org.onap.policy.models.tosca.simple.concepts.JpaToscaConstraintValidValues;
 import org.onap.policy.models.tosca.simple.concepts.JpaToscaDataType;
-import org.onap.policy.models.tosca.simple.concepts.JpaToscaEntrySchema;
 import org.onap.policy.models.tosca.simple.concepts.JpaToscaPolicyType;
 import org.onap.policy.models.tosca.simple.concepts.JpaToscaProperty;
 import org.onap.policy.models.tosca.simple.concepts.JpaToscaServiceTemplate;
@@ -170,12 +169,9 @@ public class MonitoringPolicyTypeSerializationTest {
         assertEquals("onap.policies.monitoring.cdap.tca.hi.lo.app", property.getKey().getParentKeyName());
         assertEquals(VERSION_100, property.getKey().getParentKeyVersion());
         assertEquals("tca_policy", property.getKey().getLocalName());
-        assertEquals("map", property.getType().getName());
+        assertEquals(TCA, property.getType().getName());
         assertEquals("TCA Policy JSON", property.getDescription());
 
-        JpaToscaEntrySchema entrySchema = property.getEntrySchema();
-        assertEquals(TCA, entrySchema.getType().getName());
-
         // Check data_types
         Map<PfConceptKey, JpaToscaDataType> dataTypesConceptMap = serviceTemplate.getDataTypes().getConceptMap();
         assertTrue(dataTypesConceptMap.size() == 3);