/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2020 Nordix Foundation.
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
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;
assertTrue(serviceTemplate.validate(new PfValidationResult()).isValid());
// Check tosca_definitions_version
- assertEquals("tosca_simple_yaml_1_0_0", serviceTemplate.getToscaDefinitionsVersion());
+ assertEquals("tosca_simple_yaml_1_1_0", serviceTemplate.getToscaDefinitionsVersion());
// Check policy_types
Map<PfConceptKey, JpaToscaPolicyType> policyTypesConceptMap = serviceTemplate.getPolicyTypes().getConceptMap();
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);
assertTrue(firstDataTypeFirstProperty.getConstraints().size() == 1);
assertEquals("org.onap.policy.models.tosca.simple.concepts.JpaToscaConstraintValidValues",
firstDataTypeFirstProperty.getConstraints().iterator().next().getClass().getName());
- assertTrue(((JpaToscaConstraintValidValues) (firstDataTypeFirstProperty.getConstraints().iterator().next()))
- .getValidValues().size() == 2);
+ assertEquals(2,
+ ((JpaToscaConstraintValidValues) (firstDataTypeFirstProperty.getConstraints().iterator().next()))
+ .getValidValues().size());
JpaToscaProperty firstDataTypeSecondProperty = firstDataTypePropertiesIter.next();
assertEquals(METRICS, firstDataTypeSecondProperty.getKey().getParentKeyName());
assertTrue(serviceTemplate.validate(new PfValidationResult()).isValid());
// Check tosca_definitions_version
- assertEquals("tosca_simple_yaml_1_0_0", serviceTemplate.getToscaDefinitionsVersion());
+ assertEquals("tosca_simple_yaml_1_1_0", serviceTemplate.getToscaDefinitionsVersion());
// Check policy_types
Map<PfConceptKey, JpaToscaPolicyType> policyTypesConceptMap = serviceTemplate.getPolicyTypes().getConceptMap();
Entry<PfConceptKey, JpaToscaPolicyType> secondPolicyType = policyTypesIter.next();
assertEquals(DCAE, secondPolicyType.getKey().getName());
assertEquals(VERSION_100, secondPolicyType.getKey().getVersion());
- assertEquals("policy.nodes.Root", secondPolicyType.getValue().getDerivedFrom().getName());
+ assertEquals("onap.policies.Monitoring", secondPolicyType.getValue().getDerivedFrom().getName());
assertTrue(secondPolicyType.getValue().getProperties().size() == 2);
Iterator<JpaToscaProperty> propertiesIter = secondPolicyType.getValue().getProperties().values().iterator();