aboutsummaryrefslogtreecommitdiffstats
path: root/mso-api-handlers/mso-api-handler-infra/src/test/java/org
diff options
context:
space:
mode:
authorJozsef Csongvai <jozsef.csongvai@bell.ca>2021-11-26 16:19:01 -0500
committerJozsef Csongvai <jozsef.csongvai@bell.ca>2021-11-26 16:52:57 -0500
commit63947de885b4736461e8810faaad0ee15899fd8b (patch)
tree8596a5d16c7e02f17242301e9bc1e76bc57a527e /mso-api-handlers/mso-api-handler-infra/src/test/java/org
parent4bfbdba3c1c9554b45c2a5c4f221853e7b572577 (diff)
Adjust RelatedInstancesValidation to enable child service requests
Issue-ID: SO-3811 Signed-off-by: Jozsef Csongvai <jozsef.csongvai@bell.ca> Change-Id: I135353f99896f1c64529adac1aa2b096388fd6e6
Diffstat (limited to 'mso-api-handlers/mso-api-handler-infra/src/test/java/org')
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/validation/RelatedInstancesValidationTest.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/validation/RelatedInstancesValidationTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/validation/RelatedInstancesValidationTest.java
index 93a19a9531..ef160e9c4c 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/validation/RelatedInstancesValidationTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/validation/RelatedInstancesValidationTest.java
@@ -31,6 +31,7 @@ import org.junit.rules.ExpectedException;
import org.onap.so.apihandlerinfra.Action;
import org.onap.so.apihandlerinfra.BaseTest;
import org.onap.so.exceptions.ValidationException;
+import org.onap.so.serviceinstancebeans.InstanceDirection;
import org.onap.so.serviceinstancebeans.RelatedInstanceList;
import org.onap.so.serviceinstancebeans.ServiceInstancesRequest;
import com.fasterxml.jackson.databind.ObjectMapper;
@@ -133,4 +134,21 @@ public class RelatedInstancesValidationTest extends BaseTest {
validation.validate(setupValidationInformation(
"src/test/resources/Validation/VpnBondingValidation/NoModelInvariantId.json"));
}
+
+ @Test
+ public void validateRelatedInstanceInstanceIdTest() throws IOException, ValidationException {
+ validation.validate(setupValidationInformation(
+ "src/test/resources/Validation/UserParamsValidation/RelatedInstanceInstanceId.json"));
+ }
+
+ @Test
+ public void validateRelatedInstanceInstanceIdExceptionTest() throws IOException, ValidationException {
+ thrown.expect(ValidationException.class);
+ thrown.expectMessage("serviceInstanceId matching the serviceInstanceId in request URI");
+ ValidationInformation info = setupValidationInformation(
+ "src/test/resources/Validation/UserParamsValidation/RelatedInstanceInstanceId.json");
+ RelatedInstanceList[] instanceList = info.sir.getRequestDetails().getRelatedInstanceList();
+ instanceList[0].getRelatedInstance().setInstanceDirection(InstanceDirection.fromValue("destination"));
+ validation.validate(info);
+ }
}