summaryrefslogtreecommitdiffstats
path: root/catalog-be/src/main/java
diff options
context:
space:
mode:
authorKrupaNagabhushan <krupa.nagabhushan@est.tech>2021-08-27 16:15:30 +0100
committerKrupa Nagabhushan <krupa.nagabhushan@est.tech>2021-08-27 15:40:41 +0000
commit37d9a984c45a2a3389b70fca38513fd4bd821e28 (patch)
treef546defc7e0dcb0b07b712d26eff769931236c4d /catalog-be/src/main/java
parentfa5940315c9a9b659a246269f74384d8aa50e34d (diff)
Improve invalid artifact label error message
Issue-ID: SDC-3691 Signed-off-by: KrupaNagabhushan <krupa.nagabhushan@est.tech> Change-Id: I72f0fbec5839ecb343a73a9ca537e2e0a6437363
Diffstat (limited to 'catalog-be/src/main/java')
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ArtifactsBusinessLogic.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ArtifactsBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ArtifactsBusinessLogic.java
index 1331cbfe7c..a566d6c73d 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ArtifactsBusinessLogic.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ArtifactsBusinessLogic.java
@@ -169,6 +169,7 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic {
private static final String COMMIT = "all changes committed";
private static final String UPDATE_ARTIFACT = "Update Artifact";
private static final String FOUND_DEPLOYMENT_ARTIFACT = "Found deployment artifact {}";
+ private static final String VALID_ARTIFACT_LABEL_NAME = "'A-Z', 'a-z', '0-9', '-', '@', '+' and space.";
private Gson gson = new GsonBuilder().setPrettyPrinting().create();
@javax.annotation.Resource
private IInterfaceLifecycleOperation interfaceLifecycleOperation;
@@ -1530,7 +1531,7 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic {
artifactInfo.setArtifactDisplayName(displayName);
if (!ValidationUtils.validateArtifactLabel(artifactLabel)) {
log.debug("Invalid format form Artifact label : {}", artifactLabel);
- return Either.right(componentsUtils.getResponseFormat(ActionStatus.INVALID_CONTENT));
+ return Either.right(componentsUtils.getResponseFormat(ActionStatus.INVALID_ARTIFACT_LABEL_NAME, VALID_ARTIFACT_LABEL_NAME));
}
artifactLabel = ValidationUtils.normalizeArtifactLabel(artifactLabel);
if (artifactLabel.isEmpty()) {