aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/org/onap/nbi/apis/serviceorder/model/ServiceSpecificationRef.java
diff options
context:
space:
mode:
authorromaingimbert <romain.gimbert@orange.com>2018-09-11 11:32:52 +0200
committerromaingimbert <romain.gimbert@orange.com>2018-09-11 11:32:52 +0200
commitbf18ae431c5e12fc7c480392d6a4881c080942f9 (patch)
tree1eb5655fcb95932cf6aa1a72a1056c31be4eca94 /src/main/java/org/onap/nbi/apis/serviceorder/model/ServiceSpecificationRef.java
parente1e184ce87a59d632253de00ebeedfe4e3f46796 (diff)
service order constraints control
-check data constraints of the service order -add test Change-Id: I73a0c405555938f191b594a4cfd2737c9c1563ec Issue-ID: EXTAPI-148 Signed-off-by: romaingimbert <romain.gimbert@orange.com>
Diffstat (limited to 'src/main/java/org/onap/nbi/apis/serviceorder/model/ServiceSpecificationRef.java')
-rwxr-xr-xsrc/main/java/org/onap/nbi/apis/serviceorder/model/ServiceSpecificationRef.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main/java/org/onap/nbi/apis/serviceorder/model/ServiceSpecificationRef.java b/src/main/java/org/onap/nbi/apis/serviceorder/model/ServiceSpecificationRef.java
index 33033b6..f4ec4e2 100755
--- a/src/main/java/org/onap/nbi/apis/serviceorder/model/ServiceSpecificationRef.java
+++ b/src/main/java/org/onap/nbi/apis/serviceorder/model/ServiceSpecificationRef.java
@@ -40,8 +40,10 @@ package org.onap.nbi.apis.serviceorder.model;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
-import javax.validation.constraints.NotNull;
import java.util.Objects;
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Pattern;
/**
* The service specification (default values, etc. are fetched from the catalogue).
@@ -86,7 +88,8 @@ public class ServiceSpecificationRef {
**/
@JsonProperty("id")
@ApiModelProperty(required = true, value = "Unique identifier of the service specification")
- @NotNull
+ @NotNull(message = "ServiceSpecification id cannot be null")
+ @Pattern(regexp="^(?!\\s*$).+", message="ServiceSpecification id cannot be empty")
public String getId() {
return id;
}
@@ -161,6 +164,7 @@ public class ServiceSpecificationRef {
**/
@JsonProperty("targetServiceSchema")
@ApiModelProperty(value = "")
+ @Valid
public TargetServiceSchema getTargetServiceSchema() {
return targetServiceSchema;
}