summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/tosca/CsarUtils.java2
-rw-r--r--common-app-api/src/main/java/org/openecomp/sdc/common/util/ValidationUtils.java2
-rw-r--r--common-app-api/src/test/java/org/openecomp/sdc/common/util/ValidationUtilsTest.java5
3 files changed, 7 insertions, 2 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/CsarUtils.java b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/CsarUtils.java
index 123e1b18ad..764213209b 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/CsarUtils.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/CsarUtils.java
@@ -153,7 +153,7 @@ public class CsarUtils {
public static final String ARTIFACTS = "Artifacts";
private static final String DEFINITION = "Definitions";
private static final String DEL_PATTERN = "([/\\\\]+)";
- private static final String WORD_PATTERN = "\\w\\_\\-\\.\\s]+)";
+ private static final String WORD_PATTERN = "\\w\\_\\@\\-\\.\\s]+)";
public static final String VALID_ENGLISH_ARTIFACT_NAME = "([" + WORD_PATTERN;
private static final String VALID_ENGLISH_ARTIFACT_NAME_WITH_DIGITS = "([\\d" + WORD_PATTERN;
private static final String ARTIFACT_NAME_UNIQUE_ID = "ArtifactName {}, unique ID {}";
diff --git a/common-app-api/src/main/java/org/openecomp/sdc/common/util/ValidationUtils.java b/common-app-api/src/main/java/org/openecomp/sdc/common/util/ValidationUtils.java
index 57cf96e068..dfecf927d8 100644
--- a/common-app-api/src/main/java/org/openecomp/sdc/common/util/ValidationUtils.java
+++ b/common-app-api/src/main/java/org/openecomp/sdc/common/util/ValidationUtils.java
@@ -99,7 +99,7 @@ public class ValidationUtils {
Arrays.asList("of", "to", "for", "as", "a", "an", "the"));
public static final Pattern COST_PATTERN = Pattern.compile("^[0-9]{1,5}\\.[0-9]{1,3}$");
- public static final Pattern ARTIFACT_LABEL_PATTERN = Pattern.compile("^[a-zA-Z0-9 \\-+]+$");
+ public static final Pattern ARTIFACT_LABEL_PATTERN = Pattern.compile("^[a-zA-Z0-9 \\-@+]+$");
public static final Integer ARTIFACT_LABEL_LENGTH = 255;
public static final Pattern ARTIFACT_DISPLAY_NAME_PATTERN = Pattern.compile("^[a-zA-Z0-9][a-zA-Z0-9 &\\.'#=:@_\\-+]+$");
public static final Pattern CATEGORY_LABEL_PATTERN = Pattern.compile("^[a-zA-Z0-9][a-zA-Z0-9 &\\.'#=:@_\\-+]+$");
diff --git a/common-app-api/src/test/java/org/openecomp/sdc/common/util/ValidationUtilsTest.java b/common-app-api/src/test/java/org/openecomp/sdc/common/util/ValidationUtilsTest.java
index 467f1cf545..2d5122a13f 100644
--- a/common-app-api/src/test/java/org/openecomp/sdc/common/util/ValidationUtilsTest.java
+++ b/common-app-api/src/test/java/org/openecomp/sdc/common/util/ValidationUtilsTest.java
@@ -902,6 +902,11 @@ final String testArtifactDisplayName="test=notValid=Label";
}
@Test
+ public void checkValidateArtifactLabelReturnsTrueWithAtSymbol() {
+ assertTrue(ValidationUtils.validateArtifactLabel("test@label"));
+ }
+
+ @Test
public void checkValidateConsumerNameReturnsTrueIfLabelIsValid() {
final String testConsumerName = "testConsumerName";