diff options
Diffstat (limited to 'src/test/java/org')
-rw-r--r-- | src/test/java/org/onap/nbi/apis/ApiTest.java | 10 | ||||
-rw-r--r-- | src/test/java/org/onap/nbi/apis/assertions/ServiceOrderAssertions.java | 2 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/test/java/org/onap/nbi/apis/ApiTest.java b/src/test/java/org/onap/nbi/apis/ApiTest.java index 4d24062..489af4e 100644 --- a/src/test/java/org/onap/nbi/apis/ApiTest.java +++ b/src/test/java/org/onap/nbi/apis/ApiTest.java @@ -47,6 +47,7 @@ import org.onap.nbi.apis.serviceorder.model.RelatedParty; import org.onap.nbi.apis.serviceorder.model.Service; import org.onap.nbi.apis.serviceorder.model.ServiceOrder; import org.onap.nbi.apis.serviceorder.model.ServiceOrderItem; +import org.onap.nbi.apis.serviceorder.model.ServiceSpecificationRef; import org.onap.nbi.apis.serviceorder.model.StateType; import org.onap.nbi.apis.serviceorder.model.orchestrator.ExecutionTask; import org.onap.nbi.apis.serviceorder.repositories.ExecutionTaskRepository; @@ -736,6 +737,15 @@ public class ApiTest { violations = validator.validate(serviceOrder); assertThat(violations).isNotEmpty(); + + ServiceOrder serviceOrder2 = ServiceOrderAssertions.createTestServiceOrder(ActionType.ADD); + serviceOrder2.getOrderItem().get(0).getService().getServiceSpecification().setId(""); + serviceOrder2.getOrderItem().get(1).getService().getServiceSpecification().setId(" "); + + violations = validator.validate(serviceOrder2); + assertThat(violations).isNotEmpty(); + assertThat(violations.size()).isEqualTo(2); + } diff --git a/src/test/java/org/onap/nbi/apis/assertions/ServiceOrderAssertions.java b/src/test/java/org/onap/nbi/apis/assertions/ServiceOrderAssertions.java index 65686d2..5ff1816 100644 --- a/src/test/java/org/onap/nbi/apis/assertions/ServiceOrderAssertions.java +++ b/src/test/java/org/onap/nbi/apis/assertions/ServiceOrderAssertions.java @@ -23,6 +23,7 @@ import org.onap.nbi.apis.serviceorder.model.ActionType; import org.onap.nbi.apis.serviceorder.model.OrderItemRelationship; import org.onap.nbi.apis.serviceorder.model.OrderRelationship; import org.onap.nbi.apis.serviceorder.model.RelatedParty; +import org.onap.nbi.apis.serviceorder.model.RelationshipType; import org.onap.nbi.apis.serviceorder.model.ResourceSpecification; import org.onap.nbi.apis.serviceorder.model.Service; import org.onap.nbi.apis.serviceorder.model.ServiceCharacteristic; @@ -155,6 +156,7 @@ public class ServiceOrderAssertions { List<OrderItemRelationship> orderItemRelationships = new ArrayList<>(); OrderItemRelationship orderItemRelationship = new OrderItemRelationship(); orderItemRelationship.setId("A"); + orderItemRelationship.setType(RelationshipType.RELIESON); orderItemRelationships.add(orderItemRelationship); itemB.setOrderItemRelationship(orderItemRelationships); items.add(itemB); |