diff options
author | ayalaben <ayala.benzvi@amdocs.com> | 2018-08-16 11:08:21 +0300 |
---|---|---|
committer | ayalaben <ayala.benzvi@amdocs.com> | 2018-08-16 11:08:21 +0300 |
commit | 1c519a911f04a03d066b123d011e37902b0941fc (patch) | |
tree | f44307689ef86bb59179ceb4287090c88f3a774f /workflow-designer-be/src/main | |
parent | e131bf1bb08a3ebe81522ae90a3ce60e72cc865b (diff) |
Workflow name validation
Change-Id: I6ff7175b84f32deb5e66ce9a3597bb2e32c12e70
Issue-ID: SDC-1654
Signed-off-by: ayalaben <ayala.benzvi@amdocs.com>
Diffstat (limited to 'workflow-designer-be/src/main')
2 files changed, 5 insertions, 4 deletions
diff --git a/workflow-designer-be/src/main/java/org/onap/sdc/workflow/persistence/types/ParameterEntity.java b/workflow-designer-be/src/main/java/org/onap/sdc/workflow/persistence/types/ParameterEntity.java index c7f7d17e..bc813f24 100644 --- a/workflow-designer-be/src/main/java/org/onap/sdc/workflow/persistence/types/ParameterEntity.java +++ b/workflow-designer-be/src/main/java/org/onap/sdc/workflow/persistence/types/ParameterEntity.java @@ -16,6 +16,7 @@ package org.onap.sdc.workflow.persistence.types; +import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; import javax.validation.constraints.Pattern; import lombok.Data; @@ -24,7 +25,7 @@ import lombok.Data; public class ParameterEntity { private String id; - @NotNull(message = "Parameter name may not be null") + @NotBlank(message = "Parameter Name may not be blank") @Pattern(regexp = "[A-Za-z0-9_ ]+", message = "Parameter name must contain only letters, digits and underscores") private String name; @NotNull diff --git a/workflow-designer-be/src/main/java/org/onap/sdc/workflow/services/types/Workflow.java b/workflow-designer-be/src/main/java/org/onap/sdc/workflow/services/types/Workflow.java index dde708da..f312f7b4 100644 --- a/workflow-designer-be/src/main/java/org/onap/sdc/workflow/services/types/Workflow.java +++ b/workflow-designer-be/src/main/java/org/onap/sdc/workflow/services/types/Workflow.java @@ -19,7 +19,7 @@ package org.onap.sdc.workflow.services.types; import java.util.Collection; import java.util.Set; -import javax.validation.constraints.NotNull; +import javax.validation.constraints.NotBlank; import javax.validation.constraints.Pattern; import javax.validation.constraints.Size; import lombok.Data; @@ -29,9 +29,9 @@ import lombok.Data; public class Workflow { private String id; - @NotNull(message = "Workflow name may not be null") + @NotBlank(message = "Workflow name may not be blank") @Size(max = 80, message = "Workflow name must be less than 80 characters") - @Pattern(regexp = "[A-Za-z0-9_ ]*", message = "Workflow name must contain only letters, digits and underscores") + @Pattern(regexp = "[A-Za-z0-9_ ]+", message = "Workflow name must contain only letters, digits and underscores") private String name; private String description; private Set<WorkflowVersionState> versionStates; |