From 3af9347e47302e3f6754cba8ea2b63772980a5d9 Mon Sep 17 00:00:00 2001 From: sebdet Date: Mon, 9 Mar 2020 16:15:19 -0700 Subject: Rework tosca converter Fix the tosca converter template to support json instead of properties file. Issue-ID: CLAMP-253 Signed-off-by: sebdet Change-Id: Id4f839d0b5bfece519b0b1e615e8d6e14e464f16 --- .../onap/clamp/clds/tosca/update/Extractor.java | 11 +- .../org/onap/clamp/clds/tosca/update/Field.java | 147 ++++++++ .../onap/clamp/clds/tosca/update/ParserToJson.java | 12 +- .../org/onap/clamp/clds/tosca/update/Template.java | 148 +++++++- .../clds/tosca/update/TemplateManagement.java | 50 +-- src/main/java/org/onap/clamp/policy/Policy.java | 4 +- .../policy/microservice/MicroServicePolicy.java | 10 +- .../microservice/MicroServicePolicyService.java | 7 +- src/main/resources/META-INF/resources/swagger.html | 90 ++--- src/main/resources/application-noaaf.properties | 5 +- src/main/resources/application.properties | 2 +- .../resources/clds/tosca_update/templates.json | 398 +++++++++++++++++++++ .../clamp/clds/tosca/update/ArrayFieldTest.java | 2 +- .../clamp/clds/tosca/update/ComponentTest.java | 2 +- .../clamp/clds/tosca/update/ConstraintTest.java | 2 +- .../onap/clamp/clds/tosca/update/PropertyTest.java | 4 +- .../clds/tosca/update/TemplateManagementTest.java | 32 +- .../onap/clamp/clds/tosca/update/TemplateTest.java | 4 +- .../PolicyEngineControllerTestItCase.java | 3 +- src/test/resources/application.properties | 5 +- 20 files changed, 817 insertions(+), 121 deletions(-) create mode 100644 src/main/java/org/onap/clamp/clds/tosca/update/Field.java create mode 100644 src/main/resources/clds/tosca_update/templates.json (limited to 'src') diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/Extractor.java b/src/main/java/org/onap/clamp/clds/tosca/update/Extractor.java index b0bf8278..c6eabcd3 100644 --- a/src/main/java/org/onap/clamp/clds/tosca/update/Extractor.java +++ b/src/main/java/org/onap/clamp/clds/tosca/update/Extractor.java @@ -23,7 +23,6 @@ package org.onap.clamp.clds.tosca.update; -import java.io.IOException; import java.util.LinkedHashMap; import java.util.Map.Entry; import org.yaml.snakeyaml.Yaml; @@ -33,14 +32,18 @@ public class Extractor { private String source; private String nativeComponent; - @SuppressWarnings("unchecked") - public Extractor(String toParse, String nativeComponent) throws IOException { + /** + * Constructor. + * + * @param toParse Tosca to parse + * @param nativeComponent The policy type to scan + */ + public Extractor(String toParse, String nativeComponent) { this.source = toParse; this.nativeComponent = nativeComponent; allItems = new LinkedHashMap(); getAllAsMaps(); - } public LinkedHashMap getAllItems() { diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/Field.java b/src/main/java/org/onap/clamp/clds/tosca/update/Field.java new file mode 100644 index 00000000..e01f14c4 --- /dev/null +++ b/src/main/java/org/onap/clamp/clds/tosca/update/Field.java @@ -0,0 +1,147 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP CLAMP + * ================================================================================ + * Copyright (C) 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END============================================ + * =================================================================== + * + */ + +package org.onap.clamp.clds.tosca.update; + +public class Field { + private String title; + private Object value; + private Boolean visible; + private Boolean staticValue; + + public Field(String title) { + this.title = title; + } + + /** + * Constructor. + * + * @param title The title + * @param value The value + * @param visible visible or not + * @param staticValue The static value + */ + public Field(String title, Object value, Boolean visible, Boolean staticValue) { + this.title = title; + this.value = value; + this.visible = visible; + this.staticValue = staticValue; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public Object getValue() { + return value; + } + + public void setValue(Object value) { + this.value = value; + } + + public Boolean getVisible() { + return visible; + } + + public void setVisible(Boolean visible) { + this.visible = visible; + } + + public Boolean getStaticValue() { + return staticValue; + } + + public void setStaticValue(Boolean staticValue) { + this.staticValue = staticValue; + } + + public String toString() { + return title + " " + value + " " + visible + " " + staticValue; + } + + /** + * This method compares two fields. + * + * @param otherField Compare the current object with the one specified + * @return true if they are totally equals, false otherwise + */ + public boolean compareWithField(Object otherField) { + if (this == otherField) { + return true; + } + if (otherField == null || getClass() != otherField.getClass()) { + return false; + } + + Field field = (Field) otherField; + + if (title != null ? !title.equals(field.title) : field.title != null) { + return false; + } + if (value != null ? !value.equals(field.value) : field.value != null) { + return false; + } + if (visible != null ? !visible.equals(field.visible) : field.visible != null) { + return false; + } + return staticValue != null ? staticValue.equals(field.staticValue) : field.staticValue == null; + } + + @Override + public boolean equals(Object object) { + if (this == object) { + return true; + } + if (object == null || getClass() != object.getClass()) { + return false; + } + + Field field = (Field) object; + + return title != null ? title.equals(field.title) : field.title == null; + } + + @Override + public int hashCode() { + return title != null ? title.hashCode() : 0; + } + + /** + * This method test the entire equality. + * + * @param field1 object one + * @param field2 object two + * @return true if they are totally equals (all attributes, false otherwise + */ + public static boolean fieldsEquals(Field field1, Field field2) { + return (field2.getTitle().equals(field1.getTitle()) && field2.getValue().equals(field1.getValue()) + && field2.getVisible().equals(field1.getVisible()) + && field2.getStaticValue().equals(field1.getStaticValue())); + } + +} diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/ParserToJson.java b/src/main/java/org/onap/clamp/clds/tosca/update/ParserToJson.java index 7bf629d6..3c5cf975 100644 --- a/src/main/java/org/onap/clamp/clds/tosca/update/ParserToJson.java +++ b/src/main/java/org/onap/clamp/clds/tosca/update/ParserToJson.java @@ -227,7 +227,7 @@ public class ParserToJson { switch ((String) property.getItems().get("type")) { case "map": // Get it as an object - JsonObject componentAsProperty = child.getJsonProcess(nameComponent,"object"); + JsonObject componentAsProperty = child.getJsonProcess(nameComponent, "object"); propertiesContainer.add(nameComponent, componentAsProperty); if (currentPropertyTemplate.hasFields("properties")) { propertiesInJson.add("properties", propertiesContainer); @@ -247,13 +247,13 @@ public class ParserToJson { JsonObject itemContainer = new JsonObject(); String valueInEntrySchema = this.extractSpecificFieldFromMap(property, "entry_schema"); itemContainer.addProperty("type", valueInEntrySchema); - propertiesInJson.add("items", itemContainer); - } - else {//map - // propertiesInJson.add("key?", valueInEntrySchema); + propertiesInJson.add("items", itemContainer); } + // MAP Case, for now nothing + break; - default://Each classical field : type, description, default.. + default: + //Each classical field : type, description, default.. if (currentPropertyTemplate.hasFields(propertyField) && !propertyField.equals("required")) { property.addFieldToJson(propertiesInJson, propertyField, property.getItems().get(propertyField)); diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/Template.java b/src/main/java/org/onap/clamp/clds/tosca/update/Template.java index 34459067..4507e3d7 100644 --- a/src/main/java/org/onap/clamp/clds/tosca/update/Template.java +++ b/src/main/java/org/onap/clamp/clds/tosca/update/Template.java @@ -23,7 +23,9 @@ package org.onap.clamp.clds.tosca.update; +import com.google.gson.JsonObject; import java.util.ArrayList; +import java.util.List; public class Template { @@ -31,14 +33,14 @@ public class Template { * name parameter is used as "key", in the LinkedHashMap of Templates. */ private String name; - private ArrayList fields; + private List fields; public Template(String name) { this.name = name; - this.fields = new ArrayList(); + this.fields = new ArrayList<>(); } - public Template(String name, ArrayList fields) { + public Template(String name, List fields) { this.name = name; this.fields = fields; } @@ -51,26 +53,94 @@ public class Template { this.name = name; } - public ArrayList getFields() { + public List getFields() { return fields; } - public void setFields(ArrayList fields) { + public void setFields(List fields) { this.fields = fields; } - public boolean hasFields(String name) { - return fields.contains(name); + /** + * Search in fields if fieldName exists. + * + * @param fieldName The field name + * @return Ture if it exists, false otherwise + */ + public boolean hasFields(String fieldName) { + for (Field field : this.getFields()) { + if (field.getTitle().equals(fieldName)) { + return true; + } + } + return false; + } + + /** + * Get a specific Field. + * + * @param fieldName The field name + * @return THe Field found + */ + public Field getSpecificField(String fieldName) { + for (Field field : this.getFields()) { + if (field.getTitle().equals(fieldName)) { + return field; + } + } + return null; } - public void addField(String field) { + public void addField(Field field) { fields.add(field); } - public void removeField(String field) { + public void removeField(Field field) { fields.remove(field); } + /** + * Enable or disable the visibility. + * + * @param nameField THe field name + * @param state True or false + */ + public void setVisibility(String nameField, boolean state) { + for (Field field : this.fields) { + if (field.getTitle().equals(nameField)) { + field.setVisible(state); + } + } + } + + /** + * This method defines if a field is static or not. + * + * @param nameField The name of the field + * @param state true or false + */ + public void setStatic(String nameField, boolean state) { + for (Field field : this.fields) { + if (field.getTitle().equals(nameField)) { + field.setStaticValue(state); + } + } + } + + /** + * This method updates the value of a specfic field. + * + * @param nameField The name of the field + * @param newValue The new value as Object + */ + public void updateValueField(String nameField, Object newValue) { + for (Field field : this.fields) { + if (field.getTitle().equals(nameField)) { + field.setValue(newValue); + } + } + } + /** * Compare two templates : size and their contents. * @@ -78,15 +148,15 @@ public class Template { * @return a boolean */ public boolean checkFields(Template template) { - boolean duplicateFields = false; if (template.getFields().size() == this.getFields().size()) { int countMatchingFields = 0; //loop each component of first - for (String templateField : template.getFields()) { - //if component.key is present in the second - if (this.getFields().contains(templateField)) { - countMatchingFields++; + for (Field templateFieldToCheck : template.getFields()) { + for (Field templateField : this.getFields()) { + if (templateFieldToCheck.compareWithField(templateField)) { + countMatchingFields++; + } } } @@ -97,6 +167,56 @@ public class Template { return duplicateFields; } + /** + * This method gets the specific field status. + * + * @param field The field name + * @return true or false + */ + public boolean fieldStaticStatus(String field) { + if (this.hasFields(field) && this.getSpecificField(field).getStaticValue().equals(true) + && this.getSpecificField(field).getValue() != null) { + return true; + } + return false; + } + + public boolean isVisible(String field) { + return this.getSpecificField(field).getVisible(); + } + + /** + * Set the value of a property of the Field in the json. + * + * @param jsonSchema The Json schema + * @param fieldName The Field name + * @param value The value + */ + public void setValue(JsonObject jsonSchema, String fieldName, String value) { + if (isVisible(fieldName)) { + if (fieldStaticStatus(fieldName)) { + String defaultValue = (String) this.getSpecificField(fieldName).getValue(); + jsonSchema.addProperty(fieldName, defaultValue); + } + else { + jsonSchema.addProperty(fieldName, value); + } + } + } + + /** + * Inject a static value in the json. + * + * @param jsonSchema The json schema object + * @param fieldName The field name + */ + public void injectStaticValue(JsonObject jsonSchema, String fieldName) { + if (isVisible(fieldName)) { + Field toInject = this.getSpecificField(fieldName); + jsonSchema.addProperty(fieldName, (String) toInject.getValue()); + } + } + @Override public String toString() { return " fields : " + fields; diff --git a/src/main/java/org/onap/clamp/clds/tosca/update/TemplateManagement.java b/src/main/java/org/onap/clamp/clds/tosca/update/TemplateManagement.java index ce5cdb81..74307715 100644 --- a/src/main/java/org/onap/clamp/clds/tosca/update/TemplateManagement.java +++ b/src/main/java/org/onap/clamp/clds/tosca/update/TemplateManagement.java @@ -23,14 +23,14 @@ package org.onap.clamp.clds.tosca.update; +import com.google.gson.JsonElement; import com.google.gson.JsonObject; import java.io.IOException; -import java.io.StringReader; -import java.util.ArrayList; -import java.util.Arrays; import java.util.Collection; import java.util.LinkedHashMap; -import java.util.Properties; +import java.util.List; +import java.util.Map; +import org.onap.clamp.clds.util.JsonUtils; public class TemplateManagement { @@ -93,7 +93,7 @@ public class TemplateManagement { * @param name name * @param fields fields */ - public void addTemplate(String name, ArrayList fields) { + public void addTemplate(String name, List fields) { Template template = new Template(name, fields); //If it is true, the operation does not have any interest : // replace OR put two different object with the same body @@ -115,17 +115,17 @@ public class TemplateManagement { * Update Template : adding with true flag, removing with false. * * @param nameTemplate name template - * @param fieldName field name + * @param field field name * @param operation operation */ - public void updateTemplate(String nameTemplate, String fieldName, Boolean operation) { + public void updateTemplate(String nameTemplate, Field field, Boolean operation) { // Operation = true && field is not present => add Field - if (operation && !this.templates.get(nameTemplate).getFields().contains(fieldName)) { - this.templates.get(nameTemplate).addField(fieldName); + if (operation && !this.templates.get(nameTemplate).getFields().contains(field)) { + this.templates.get(nameTemplate).addField(field); } // Operation = false && field is present => remove Field - else if (!operation && this.templates.get(nameTemplate).getFields().contains(fieldName)) { - this.templates.get(nameTemplate).removeField(fieldName); + else if (!operation && this.templates.get(nameTemplate).getFields().contains(field)) { + this.templates.get(nameTemplate).removeField(field); } } @@ -162,20 +162,30 @@ public class TemplateManagement { /** * Create and complete several Templates from file.properties. * - * @param templateProperties The template properties as String + * @param jsonTemplates The template properties as String * @return a map */ - private LinkedHashMap initializeTemplates(String templateProperties) throws IOException { - LinkedHashMap generatedTemplates = new LinkedHashMap<>(); - Properties templates = new Properties(); - templates.load(new StringReader(templateProperties)); + @SuppressWarnings("unused") + private LinkedHashMap initializeTemplates(String jsonTemplates) { - for (Object key : templates.keySet()) { - String fields = (String) templates.get(key); - String[] fieldsInArray = fields.split(","); - Template template = new Template((String) key, new ArrayList<>(Arrays.asList(fieldsInArray))); + LinkedHashMap generatedTemplates = new LinkedHashMap<>(); + JsonObject templates = JsonUtils.GSON.fromJson(jsonTemplates, JsonObject.class); + + for (Map.Entry templateAsJson : templates.entrySet()) { + Template template = new Template(templateAsJson.getKey()); + JsonObject templateBody = (JsonObject) templateAsJson.getValue(); + for (Map.Entry field : templateBody.entrySet()) { + String fieldName = field.getKey(); + JsonObject bodyFieldAsJson = (JsonObject) field.getValue(); + Object fieldValue = bodyFieldAsJson.get("defaultValue").getAsString(); + Boolean fieldVisible = bodyFieldAsJson.get("visible").getAsBoolean(); + Boolean fieldStatic = bodyFieldAsJson.get("static").getAsBoolean(); + Field bodyField = new Field(fieldName, fieldValue, fieldVisible, fieldStatic); + template.getFields().add(bodyField); + } generatedTemplates.put(template.getName(), template); } return generatedTemplates; } + } diff --git a/src/main/java/org/onap/clamp/policy/Policy.java b/src/main/java/org/onap/clamp/policy/Policy.java index 004c450a..d52e418e 100644 --- a/src/main/java/org/onap/clamp/policy/Policy.java +++ b/src/main/java/org/onap/clamp/policy/Policy.java @@ -294,7 +294,7 @@ public abstract class Policy extends AuditEntity { * @param policyModelType The tosca model type (the policy_type entry in the tosca) that will used to create the * json schema * @return THe Json Schema as JsonObject - * @throws IOException In case of failure when opening the templates.properties file + * @throws IOException In case of failure when opening the templates.json file * @throws UnknownComponentException If the policyModelType is not found in the tosca model */ public static JsonObject generateJsonRepresentationFromToscaModel(String policyToscaModel, @@ -302,7 +302,7 @@ public abstract class Policy extends AuditEntity { throws IOException, UnknownComponentException { return new TemplateManagement(policyToscaModel,ResourceFileUtil.getResourceAsString( "clds/tosca_update/defaultToscaTypes.yaml"), - ResourceFileUtil.getResourceAsString("clds/tosca_update/templates.properties")) + ResourceFileUtil.getResourceAsString("clds/tosca_update/templates.json")) .launchTranslation(policyModelType); } } diff --git a/src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicy.java b/src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicy.java index 96b3a09b..b8093ccf 100644 --- a/src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicy.java +++ b/src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicy.java @@ -108,7 +108,9 @@ public class MicroServicePolicy extends Policy implements Serializable { this.setPolicyModel(policyModel); this.shared = shared; try { - this.setJsonRepresentation(Policy.generateJsonRepresentationFromToscaModel(policyModel.getPolicyModelTosca(),policyModel.getPolicyModelType())); + this.setJsonRepresentation( + Policy.generateJsonRepresentationFromToscaModel(policyModel.getPolicyModelTosca(), + policyModel.getPolicyModelType())); } catch (UnknownComponentException | NullPointerException | IOException e) { logger.error("Unable to generate the microservice policy Schema ... ", e); this.setJsonRepresentation(new JsonObject()); @@ -130,7 +132,8 @@ public class MicroServicePolicy extends Policy implements Serializable { * @param pdpSubgroup The Pdp Subgrouop info */ public MicroServicePolicy(String name, PolicyModel policyModel, Boolean shared, - JsonObject jsonRepresentation, LoopElementModel loopElementModel, String pdpGroup, String pdpSubgroup) { + JsonObject jsonRepresentation, LoopElementModel loopElementModel, String pdpGroup, + String pdpSubgroup) { this.name = name; this.setPolicyModel(policyModel); this.shared = shared; @@ -265,7 +268,8 @@ public class MicroServicePolicy extends Policy implements Serializable { if (other.name != null) { return false; } - } else if (!name.equals(other.name)) { + } + else if (!name.equals(other.name)) { return false; } return true; diff --git a/src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicyService.java b/src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicyService.java index 3ad97c59..9bc641c6 100644 --- a/src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicyService.java +++ b/src/main/java/org/onap/clamp/policy/microservice/MicroServicePolicyService.java @@ -63,11 +63,12 @@ public class MicroServicePolicyService implements PolicyService updateMicroservicePolicyProperties(p, policy, loop)) .orElse(new MicroServicePolicy(policy.getName(), policy.getPolicyModel(), - policy.getShared(), policy.getJsonRepresentation(),null, policy.getPdpGroup(), policy.getPdpSubgroup()))); + policy.getShared(), policy.getJsonRepresentation(), null, policy.getPdpGroup(), + policy.getPdpSubgroup()))); } private MicroServicePolicy updateMicroservicePolicyProperties(MicroServicePolicy oldPolicy, - MicroServicePolicy newPolicy, Loop loop) { + MicroServicePolicy newPolicy, Loop loop) { oldPolicy.setConfigurationsJson(newPolicy.getConfigurationsJson()); if (!oldPolicy.getUsedByLoops().contains(loop)) { oldPolicy.getUsedByLoops().add(loop); @@ -85,7 +86,7 @@ public class MicroServicePolicyService implements PolicyServiceh2{page-b
  • 2. Paths
      -
    • 2.1. GET /v1/healthcheck +
    • 2.1. GET /v1/healthcheck
    • -
    • 2.2. GET /v1/user/getUser +
    • 2.2. GET /v1/user/getUser
    • -
    • 2.3. GET /v2/dictionary +
    • 2.3. GET /v2/dictionary
    • -
    • 2.4. PUT /v2/dictionary +
    • 2.4. PUT /v2/dictionary
    • -
    • 2.8. DELETE /v2/dictionary/{name} +
    • 2.8. DELETE /v2/dictionary/{name}
    • -
    • 2.10. PUT /v2/loop/delete/{loopName} +
    • 2.10. PUT /v2/loop/delete/{loopName}
    • -
    • 2.11. PUT /v2/loop/deploy/{loopName} +
    • 2.11. PUT /v2/loop/deploy/{loopName}
    • -
    • 2.12. GET /v2/loop/getAllNames +
    • 2.12. GET /v2/loop/getAllNames
    • -
    • 2.13. GET /v2/loop/getstatus/{loopName} +
    • 2.13. GET /v2/loop/getstatus/{loopName}
    • -
    • 2.14. PUT /v2/loop/refreshOpPolicyJsonSchema/{loopName} +
    • 2.14. PUT /v2/loop/refreshOpPolicyJsonSchema/{loopName}
    • -
    • 2.15. PUT /v2/loop/restart/{loopName} +
    • 2.15. PUT /v2/loop/restart/{loopName}
    • -
    • 2.16. PUT /v2/loop/stop/{loopName} +
    • 2.16. PUT /v2/loop/stop/{loopName}
    • -
    • 2.17. PUT /v2/loop/submit/{loopName} +
    • 2.17. PUT /v2/loop/submit/{loopName}
    • -
    • 2.18. GET /v2/loop/svgRepresentation/{loopName} +
    • 2.18. GET /v2/loop/svgRepresentation/{loopName}
    • -
    • 2.19. PUT /v2/loop/undeploy/{loopName} +
    • 2.19. PUT /v2/loop/undeploy/{loopName}
    • -
    • 2.20. POST /v2/loop/updateGlobalProperties/{loopName} +
    • 2.20. POST /v2/loop/updateGlobalProperties/{loopName}
    • -
    • 2.21. POST /v2/loop/updateMicroservicePolicy/{loopName} +
    • 2.21. POST /v2/loop/updateMicroservicePolicy/{loopName}
    • -
    • 2.22. POST /v2/loop/updateOperationalPolicies/{loopName} +
    • 2.22. POST /v2/loop/updateOperationalPolicies/{loopName}
    • -
    • 2.23. GET /v2/loop/{loopName} +
    • 2.23. GET /v2/loop/{loopName}
    • -
    • 2.24. GET /v2/policyToscaModels +
    • 2.24. GET /v2/policyToscaModels
    • -
    • 2.27. PUT /v2/policyToscaModels/{policyModelType} +
    • 2.27. PUT /v2/policyToscaModels/{policyModelType}
    • -
    • 2.28. GET /v2/templates +
    • 2.28. GET /v2/templates
      • 2.28.1. Responses
      • 2.28.2. Produces
      • @@ -692,7 +692,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b

        1.2. URI scheme

        -

        Host : localhost:40597
        +

        Host : localhost:39237
        BasePath : /restservices/clds/
        Schemes : HTTP

        @@ -703,7 +703,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b

        2. Paths

        -

        2.1. GET /v1/healthcheck

        +

        2.1. GET /v1/healthcheck

        2.1.1. Responses

        @@ -740,7 +740,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
        @@ -774,7 +774,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
        @@ -811,7 +811,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
        @@ -1060,7 +1060,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
        @@ -1184,7 +1184,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
        @@ -1233,7 +1233,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
        @@ -1295,7 +1295,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
        @@ -1332,7 +1332,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
        @@ -1394,7 +1394,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
        @@ -1456,7 +1456,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
        @@ -1518,7 +1518,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
        @@ -1580,7 +1580,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
        @@ -1642,7 +1642,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
        @@ -1704,7 +1704,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
        @@ -1766,7 +1766,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
        @@ -1844,7 +1844,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
        @@ -1922,7 +1922,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
        @@ -2000,7 +2000,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
        @@ -2062,7 +2062,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
        @@ -2223,7 +2223,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
        @@ -2301,7 +2301,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
        diff --git a/src/main/resources/application-noaaf.properties b/src/main/resources/application-noaaf.properties index 320e0c2a..288511b3 100644 --- a/src/main/resources/application-noaaf.properties +++ b/src/main/resources/application-noaaf.properties @@ -173,4 +173,7 @@ clamp.config.security.permission.type.template=org.onap.clamp.clds.template clamp.config.security.permission.type.tosca=org.onap.clamp.clds.tosca #This one indicates the type of instances (dev|prod|perf...), this must be set accordingly in clds-users.properties clamp.config.security.permission.instance=dev -clamp.config.security.authentication.class=org.onap.aaf.cadi.principal.X509Principal \ No newline at end of file +clamp.config.security.authentication.class=org.onap.aaf.cadi.principal.X509Principal + +## Tosca converter +clamp.config.tosca.converter.templates=classpath:/clds/tosca_updates/templates.json \ No newline at end of file diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index ed7f4ef4..a249d2d0 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -189,7 +189,7 @@ clamp.config.cadi.aafUrl=https://AAF_LOCATE_URL/onap.org.osaaf.aaf.service:2.1 clamp.config.cadi.cadiX509Issuers=CN=intermediateCA_1, OU=OSAAF, O=ONAP, C=US:CN=intermediateCA_7, OU=OSAAF, O=ONAP, C=US:CN=intermediateCA_9, OU=OSAAF, O=ONAP, C=US ## Tosca converter -clamp.config.tosca.converter.templates=classpath:/clds/tosca_updates/templates.properties +clamp.config.tosca.converter.templates=classpath:/clds/tosca_updates/templates.json # Configuration settings for CDS clamp.config.cds.url=http4://blueprints-processor-http:8080 diff --git a/src/main/resources/clds/tosca_update/templates.json b/src/main/resources/clds/tosca_update/templates.json new file mode 100644 index 00000000..f709e2f6 --- /dev/null +++ b/src/main/resources/clds/tosca_update/templates.json @@ -0,0 +1,398 @@ +{ + "integer":{ + "type":{ + "defaultValue":"integer", + "visible":true, + "static":false + }, + "description":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "title":{ + "defaultValue":"", + "visible":true, + "static":false + + }, + "deprecated":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "default":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "enum":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "const":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "multipleOf":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "maximum":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "exclusiveMaximum":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "minimum":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "exclusiveMinimum":{ + "defaultValue":"", + "visible":true, + "static":false + } + }, + "number":{ + "type":{ + "defaultValue":"number", + "visible":true, + "static":false + }, + "description":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "title":{ + "defaultValue":"", + "visible":true, + "static":false + + }, + "deprecated":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "default":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "enum":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "const":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "multipleOf":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "maximum":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "exclusiveMaximum":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "minimum":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "exclusiveMinimum":{ + "defaultValue":"", + "visible":true, + "static":false + } + }, + "boolean":{ + "type":{ + "defaultValue":"boolean", + "visible":true, + "static":false + }, + "description":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "title":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "deprecated":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "default":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "const":{ + "defaultValue":"", + "visible":true, + "static":false + } + }, + "string":{ + "type":{ + "defaultValue":"string", + "visible":true, + "static":false + }, + "description":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "title":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "deprecated":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "default":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "enum":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "const":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "length":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "minLength":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "maxLength":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "pattern":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "format":{ + "defaultValue":"", + "visible":true, + "static":false + } + }, + "timestamp":{ + "type":{ + "defaultValue":"string", + "visible":true, + "static":false + }, + "description":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "title":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "deprecated":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "default":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "enum":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "const":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "length":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "minLength":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "maxLength":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "pattern":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "format":{ + "defaultValue":"", + "visible":true, + "static":false + } + }, + "array":{ + "type":{ + "defaultValue":"array", + "visible":true, + "static":false + }, + "description":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "title":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "deprecated":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "default":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "const":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "uniqueItems":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "properties":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "minContains":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "maxContains":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "minItems":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "maxItems":{ + "defaultValue":"", + "visible":true, + "static":false + } + }, + "object":{ + "type":{ + "defaultValue":"object", + "visible":true, + "static":false + }, + "description":{ + "defaultValue":"", + "visible":true, + "static":true + }, + "title":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "format":{ + "defaultValue":"tabs", + "visible":true, + "static":true + }, + "required":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "minProperties":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "maxProperties":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "properties":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "dependentRequired":{ + "defaultValue":"", + "visible":true, + "static":false + }, + "dependencies":{ + "defaultValue":"", + "visible":true, + "static":false + } + } +} \ No newline at end of file diff --git a/src/test/java/org/onap/clamp/clds/tosca/update/ArrayFieldTest.java b/src/test/java/org/onap/clamp/clds/tosca/update/ArrayFieldTest.java index c65c84a4..a99d4ab5 100644 --- a/src/test/java/org/onap/clamp/clds/tosca/update/ArrayFieldTest.java +++ b/src/test/java/org/onap/clamp/clds/tosca/update/ArrayFieldTest.java @@ -40,7 +40,7 @@ public class ArrayFieldTest extends TestCase { TemplateManagement templateManagement = new TemplateManagement(ResourceFileUtil.getResourceAsString( "tosca/new-converter/sampleOperationalPoliciesEXTENTED.yaml"),ResourceFileUtil.getResourceAsString( "clds/tosca_update/defaultToscaTypes.yaml"), - ResourceFileUtil.getResourceAsString("clds/tosca_update/templates.properties")); + ResourceFileUtil.getResourceAsString("clds/tosca_update/templates.json")); Component component = templateManagement.getComponents().get("onap.datatype.controlloop.Actor"); Property property = component.getProperties().get("actor"); ArrayField arrayParser = new ArrayField((ArrayList) property.getItems().get("default")); diff --git a/src/test/java/org/onap/clamp/clds/tosca/update/ComponentTest.java b/src/test/java/org/onap/clamp/clds/tosca/update/ComponentTest.java index f5d2fe6e..565547e4 100644 --- a/src/test/java/org/onap/clamp/clds/tosca/update/ComponentTest.java +++ b/src/test/java/org/onap/clamp/clds/tosca/update/ComponentTest.java @@ -42,7 +42,7 @@ public class ComponentTest extends TestCase { new TemplateManagement( ResourceFileUtil.getResourceAsString("tosca/new-converter/sampleOperationalPolicies.yaml"), ResourceFileUtil.getResourceAsString("clds/tosca_update/defaultToscaTypes.yaml"), - ResourceFileUtil.getResourceAsString("clds/tosca_update/templates.properties")); + ResourceFileUtil.getResourceAsString("clds/tosca_update/templates.json")); Component component = templateManagement.getComponents().get("onap.datatype.controlloop.Actor"); assertEquals(reference, component.propertiesNames()); } diff --git a/src/test/java/org/onap/clamp/clds/tosca/update/ConstraintTest.java b/src/test/java/org/onap/clamp/clds/tosca/update/ConstraintTest.java index 6f1046ea..a4d329e2 100644 --- a/src/test/java/org/onap/clamp/clds/tosca/update/ConstraintTest.java +++ b/src/test/java/org/onap/clamp/clds/tosca/update/ConstraintTest.java @@ -34,7 +34,7 @@ public class ConstraintTest extends TestCase { TemplateManagement templateManagement = new TemplateManagement( ResourceFileUtil.getResourceAsString("tosca/new-converter/constraints.yaml"), ResourceFileUtil.getResourceAsString("clds/tosca_update/defaultToscaTypes.yaml"), - ResourceFileUtil.getResourceAsString("clds/tosca_update/templates.properties")); + ResourceFileUtil.getResourceAsString("clds/tosca_update/templates.json")); Component component = templateManagement.getComponents().get("onap.datatype.controlloop.Operation"); diff --git a/src/test/java/org/onap/clamp/clds/tosca/update/PropertyTest.java b/src/test/java/org/onap/clamp/clds/tosca/update/PropertyTest.java index 5a995599..62def32b 100644 --- a/src/test/java/org/onap/clamp/clds/tosca/update/PropertyTest.java +++ b/src/test/java/org/onap/clamp/clds/tosca/update/PropertyTest.java @@ -43,7 +43,7 @@ public class PropertyTest extends TestCase { TemplateManagement templateManagement = new TemplateManagement( ResourceFileUtil.getResourceAsString("tosca/new-converter/sampleOperationalPoliciesEXTENTED.yaml"), ResourceFileUtil.getResourceAsString("clds/tosca_update/defaultToscaTypes.yaml"), - ResourceFileUtil.getResourceAsString("clds/tosca_update/templates.properties")); + ResourceFileUtil.getResourceAsString("clds/tosca_update/templates.json")); Component component = templateManagement.getComponents().get("onap.datatype.controlloop.Actor"); Property property = component.getProperties().get("actor"); JsonArray toTest = property.parseArray((ArrayList) property.getItems().get("default")); @@ -59,7 +59,7 @@ public class PropertyTest extends TestCase { TemplateManagement templateManagement = new TemplateManagement( ResourceFileUtil.getResourceAsString("tosca/new-converter/sampleOperationalPolicies.yaml"), ResourceFileUtil.getResourceAsString("clds/tosca_update/defaultToscaTypes.yaml"), - ResourceFileUtil.getResourceAsString("clds/tosca_update/templates.properties")); + ResourceFileUtil.getResourceAsString("clds/tosca_update/templates.json")); Component component = templateManagement.getComponents().get("onap.datatype.controlloop.operation.Failure"); Property property = component.getProperties().get("category"); Template template = templateManagement.getTemplates().get("string"); diff --git a/src/test/java/org/onap/clamp/clds/tosca/update/TemplateManagementTest.java b/src/test/java/org/onap/clamp/clds/tosca/update/TemplateManagementTest.java index 4447a98c..aaa54938 100644 --- a/src/test/java/org/onap/clamp/clds/tosca/update/TemplateManagementTest.java +++ b/src/test/java/org/onap/clamp/clds/tosca/update/TemplateManagementTest.java @@ -26,6 +26,7 @@ package org.onap.clamp.clds.tosca.update; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; +import java.util.List; import junit.framework.TestCase; import org.onap.clamp.clds.util.ResourceFileUtil; @@ -44,7 +45,7 @@ public class TemplateManagementTest extends TestCase { + ".policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0?" + "connectionTimeToLive=5000/.file"), ResourceFileUtil.getResourceAsString( "clds/tosca_update/defaultToscaTypes.yaml"), - ResourceFileUtil.getResourceAsString("clds/tosca_update/templates.properties")); + ResourceFileUtil.getResourceAsString("clds/tosca_update/templates.json")); assertNull(templateManagement.getParseToJson()); String componentName = "onap.policies.monitoring.cdap.tca.hi.lo.app"; templateManagement.launchTranslation(componentName); @@ -64,7 +65,7 @@ public class TemplateManagementTest extends TestCase { + ".policies.controlloop.guard.common.FrequencyLimiter/versions/1.0.0?" + "connectionTimeToLive=5000/.file"), ResourceFileUtil.getResourceAsString( "clds/tosca_update/defaultToscaTypes.yaml"), - ResourceFileUtil.getResourceAsString("clds/tosca_update/templates.properties")); + ResourceFileUtil.getResourceAsString("clds/tosca_update/templates.json")); assertNull(templateManagement.getParseToJson()); String componentName = "onap.policies.controlloop.guard.common.FrequencyLimiter"; templateManagement.launchTranslation(componentName); @@ -84,7 +85,7 @@ public class TemplateManagementTest extends TestCase { + ".policies.controlloop.operational.common.Apex/versions/1.0.0?" + "connectionTimeToLive=5000/.file"), ResourceFileUtil.getResourceAsString( "clds/tosca_update/defaultToscaTypes.yaml"), - ResourceFileUtil.getResourceAsString("clds/tosca_update/templates.properties")); + ResourceFileUtil.getResourceAsString("clds/tosca_update/templates.json")); assertNull(templateManagement.getParseToJson()); String componentName = "onap.policies.controlloop.operational.common.Apex"; templateManagement.launchTranslation(componentName); @@ -104,7 +105,7 @@ public class TemplateManagementTest extends TestCase { + ".policies.controlloop.operational.common.Drools/versions/1.0.0?" + "connectionTimeToLive=5000/.file"), ResourceFileUtil.getResourceAsString( "clds/tosca_update/defaultToscaTypes.yaml"), - ResourceFileUtil.getResourceAsString("clds/tosca_update/templates.properties")); + ResourceFileUtil.getResourceAsString("clds/tosca_update/templates.json")); assertNull(templateManagement.getParseToJson()); String componentName = "onap.policies.controlloop.operational.common.Drools"; templateManagement.launchTranslation(componentName); @@ -122,7 +123,7 @@ public class TemplateManagementTest extends TestCase { new TemplateManagement( ResourceFileUtil.getResourceAsString("tosca/new-converter/sampleOperationalPolicies.yaml"), ResourceFileUtil.getResourceAsString("clds/tosca_update/defaultToscaTypes.yaml"), - ResourceFileUtil.getResourceAsString("clds/tosca_update/templates.properties")); + ResourceFileUtil.getResourceAsString("clds/tosca_update/templates.json")); assertNull(templateManagement.getParseToJson()); String componentName = "onap.policies.controlloop.operational.common.Drools"; templateManagement.launchTranslation(componentName); @@ -139,10 +140,12 @@ public class TemplateManagementTest extends TestCase { new TemplateManagement( ResourceFileUtil.getResourceAsString("tosca/new-converter/sampleOperationalPolicies.yaml"), ResourceFileUtil.getResourceAsString("clds/tosca_update/defaultToscaTypes.yaml"), - ResourceFileUtil.getResourceAsString("clds/tosca_update/templates.properties")); + ResourceFileUtil.getResourceAsString("clds/tosca_update/templates.json")); int count = templateManagement.getTemplates().size(); - ArrayList templateFields = - new ArrayList<>(Arrays.asList("type", "description", "required", "metadata", "constraints")); + List templateFields = new ArrayList<>(Arrays.asList(new Field("type"), new Field("description"), + new Field( + "required"), + new Field("metadata"), new Field("constraints"))); templateManagement.addTemplate("test", templateFields); assertNotSame(count, templateManagement.getTemplates().size()); } @@ -157,7 +160,7 @@ public class TemplateManagementTest extends TestCase { new TemplateManagement( ResourceFileUtil.getResourceAsString("tosca/new-converter/sampleOperationalPolicies.yaml"), ResourceFileUtil.getResourceAsString("clds/tosca_update/defaultToscaTypes.yaml"), - ResourceFileUtil.getResourceAsString("clds/tosca_update/templates.properties")); + ResourceFileUtil.getResourceAsString("clds/tosca_update/templates.json")); int count = templateManagement.getTemplates().size(); templateManagement.removeTemplate("string"); assertNotSame(count, templateManagement.getTemplates().size()); @@ -173,9 +176,9 @@ public class TemplateManagementTest extends TestCase { new TemplateManagement( ResourceFileUtil.getResourceAsString("tosca/new-converter/sampleOperationalPolicies.yaml"), ResourceFileUtil.getResourceAsString("clds/tosca_update/defaultToscaTypes.yaml"), - ResourceFileUtil.getResourceAsString("clds/tosca_update/templates.properties")); + ResourceFileUtil.getResourceAsString("clds/tosca_update/templates.json")); int count = templateManagement.getTemplates().get("integer").getFields().size(); - templateManagement.updateTemplate("integer", "type", false); + templateManagement.updateTemplate("integer", new Field("type"), false); assertNotSame(count, templateManagement.getTemplates().get("integer").getFields().size()); } @@ -189,10 +192,11 @@ public class TemplateManagementTest extends TestCase { new TemplateManagement( ResourceFileUtil.getResourceAsString("tosca/new-converter/sampleOperationalPolicies.yaml"), ResourceFileUtil.getResourceAsString("clds/tosca_update/defaultToscaTypes.yaml"), - ResourceFileUtil.getResourceAsString("clds/tosca_update/templates.properties")); + ResourceFileUtil.getResourceAsString("clds/tosca_update/templates.json")); boolean has = true; - ArrayList templateFieldsString = - new ArrayList<>(Arrays.asList("type", "description", "required", "metadata", "constraints")); + List templateFieldsString = + new ArrayList<>(Arrays.asList(new Field("type"), new Field("description"), new Field("required"), + new Field("metadata"), new Field("constraints"))); Template templateTest = new Template("String", templateFieldsString); has = templateManagement.hasTemplate(templateTest); assertEquals(false, has); diff --git a/src/test/java/org/onap/clamp/clds/tosca/update/TemplateTest.java b/src/test/java/org/onap/clamp/clds/tosca/update/TemplateTest.java index ebc119f0..4ffb4e28 100644 --- a/src/test/java/org/onap/clamp/clds/tosca/update/TemplateTest.java +++ b/src/test/java/org/onap/clamp/clds/tosca/update/TemplateTest.java @@ -25,6 +25,7 @@ package org.onap.clamp.clds.tosca.update; import java.util.ArrayList; import java.util.Arrays; +import java.util.List; import junit.framework.TestCase; public class TemplateTest extends TestCase { @@ -34,7 +35,8 @@ public class TemplateTest extends TestCase { */ public void testCheckFields() { Template toTest = new Template("toTest"); - ArrayList fields = new ArrayList<>(Arrays.asList("type", "description", "enum")); + List fields = new ArrayList<>(Arrays.asList(new Field("type"), new Field("description"),new Field( + "enum"))); toTest.setFields(fields); Template reference = new Template("toTest"); reference.setFields(fields); diff --git a/src/test/java/org/onap/clamp/policy/downloader/PolicyEngineControllerTestItCase.java b/src/test/java/org/onap/clamp/policy/downloader/PolicyEngineControllerTestItCase.java index f08e86e8..03b2e506 100644 --- a/src/test/java/org/onap/clamp/policy/downloader/PolicyEngineControllerTestItCase.java +++ b/src/test/java/org/onap/clamp/policy/downloader/PolicyEngineControllerTestItCase.java @@ -77,7 +77,8 @@ public class PolicyEngineControllerTestItCase { .contains(new PolicyModel("onap.policies.controlloop.guard.common.FrequencyLimiter", null, "1.0.0")); assertThat(policyModelsList) .contains(new PolicyModel("onap.policies.controlloop.guard.common.Blacklist", null, "1.0.0")); - assertThat(policyModelsList).contains(new PolicyModel("onap.policies.controlloop.guard.common.MinMax", null, "2.0.0")); + assertThat(policyModelsList) + .contains(new PolicyModel("onap.policies.controlloop.guard.common.MinMax", null, "2.0.0")); // Re-do it to check that there is no issue with duplicate key policyController.synchronizeAllPolicies(); diff --git a/src/test/resources/application.properties b/src/test/resources/application.properties index 54ba0900..0e453535 100644 --- a/src/test/resources/application.properties +++ b/src/test/resources/application.properties @@ -165,4 +165,7 @@ clamp.config.security.authentication.class=org.onap.aaf.cadi.principal.X509Princ # Configuration settings for CDS clamp.config.cds.url=http4://localhost:${docker.http-cache.port.host} clamp.config.cds.userName=ccsdkapps -clamp.config.cds.password=ccsdkapps \ No newline at end of file +clamp.config.cds.password=ccsdkapps + +## Tosca converter +clamp.config.tosca.converter.templates=classpath:/clds/tosca_updates/templates.json \ No newline at end of file -- cgit 1.2.3-korg