diff options
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.java | 18 |
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); + } } |