From b2c60183d5d654b945a24ec5564807e4f691c6e8 Mon Sep 17 00:00:00 2001 From: Michael Lando Date: Mon, 7 Aug 2017 07:05:40 +0300 Subject: [SDC] code sync Change-Id: I576dd69504722c341b0f41a1f6232ed3f4bee8df Signed-off-by: Michael Lando --- .../model/jsontitan/operations/ArtifactsOperations.java | 2 ++ .../be/model/tosca/converters/HeatStringConverter.java | 1 - .../model/tosca/converters/HeatStringConverterTest.java | 16 ++++++++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/HeatStringConverterTest.java (limited to 'catalog-model/src') diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/ArtifactsOperations.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/ArtifactsOperations.java index b8d8cb39de..07c2f8d51c 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/ArtifactsOperations.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/ArtifactsOperations.java @@ -269,6 +269,8 @@ public class ArtifactsOperations extends BaseOperation { } else { updateVersionAndDate(artifactData, oldVesrion); } + long time = System.currentTimeMillis(); + artifactData.setHeatParamsUpdateDate(time); break; case HEAT: case HEAT_NET: diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/converters/HeatStringConverter.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/converters/HeatStringConverter.java index c8fac11b3a..3f2b6eabf7 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/converters/HeatStringConverter.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/converters/HeatStringConverter.java @@ -45,7 +45,6 @@ public class HeatStringConverter implements PropertyValueConverter { coverted = ValidationUtils.normaliseWhitespace(coverted); coverted = ValidationUtils.stripOctets(coverted); coverted = ValidationUtils.removeHtmlTagsOnly(coverted); - coverted = coverted.replaceAll("\"", "").replaceAll("\'", ""); } return coverted; } diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/HeatStringConverterTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/HeatStringConverterTest.java new file mode 100644 index 0000000000..285dd9a965 --- /dev/null +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/converters/HeatStringConverterTest.java @@ -0,0 +1,16 @@ +package org.openecomp.sdc.be.model.tosca.converters; + +import org.junit.Test; + +import static org.junit.Assert.assertEquals; + +public class HeatStringConverterTest { + + @Test + public void convertString_strWithQuotes_returnStringAsIs() { + String str = "'i'm string with \"quote\"'"; + String convert = HeatStringConverter.getInstance().convert(str, null, null); + assertEquals(str, convert); + } + +} -- cgit 1.2.3-korg