diff options
author | Bonkur, Venkat <venkat.bonkur@att.com> | 2019-09-30 11:53:30 -0400 |
---|---|---|
committer | Benjamin, Max (mb388a) <mb388a@att.com> | 2019-09-30 11:53:31 -0400 |
commit | 05bf733e32e24c945b00c08f1d1d2e69da9d5eff (patch) | |
tree | 6d28cfd14f79dafa423cb9165a2bd73822c41b6b /mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap | |
parent | 4e944d4149bfcf7196691c57f3ae6659ffd05960 (diff) |
Add null check for the InfraActiveRequests lookup
Add null check for the InfraActiveRequests lookup
move it into a separate method for InfraActiveRequests lookup
Issue-ID: SO-2374
Signed-off-by: Benjamin, Max (mb388a) <mb388a@att.com>
Change-Id: I84ff23b4da12719b589d43135a7604a2d4b24fef
Diffstat (limited to 'mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap')
2 files changed, 12 insertions, 1 deletions
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/OrchestrationRequestsTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/OrchestrationRequestsTest.java index 12f0ffcc11..151785dbeb 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/OrchestrationRequestsTest.java +++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/OrchestrationRequestsTest.java @@ -335,7 +335,7 @@ public class OrchestrationRequestsTest extends BaseTest { expectedRequestError = new RequestError(); se = new ServiceException(); se.setMessageId(ErrorNumbers.SVC_DETAILED_SERVICE_ERROR); - se.setText("Null response from RequestDB when searching by RequestId"); + se.setText("Null response from RequestDB when searching by RequestId " + INVALID_REQUEST_ID); expectedRequestError.setServiceException(se); builder = UriComponentsBuilder.fromHttpUrl( diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/OrchestrationRequestsUnitTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/OrchestrationRequestsUnitTest.java index 627bbc631d..47aa3cccb5 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/OrchestrationRequestsUnitTest.java +++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/OrchestrationRequestsUnitTest.java @@ -21,6 +21,7 @@ package org.onap.so.apihandlerinfra; import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs; +import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertEquals; @@ -39,6 +40,7 @@ import org.mockito.Mock; import org.mockito.junit.MockitoJUnitRunner; import org.onap.so.apihandler.common.ResponseBuilder; import org.onap.so.apihandlerinfra.exceptions.ApiException; +import org.onap.so.apihandlerinfra.exceptions.ValidateException; import org.onap.so.constants.OrchestrationRequestFormat; import org.onap.so.constants.Status; import org.onap.so.db.request.beans.InfraActiveRequests; @@ -327,4 +329,13 @@ public class OrchestrationRequestsUnitTest { assertEquals(Status.FAILED.toString(), result); } + + @Test + public void infraActiveRequestNullValidationExceptionTest() throws ApiException { + iar.setRequestId(REQUEST_ID); + thrown.expect(ValidateException.class); + thrown.expectMessage(containsString("Null response from RequestDB when searching by RequestId " + REQUEST_ID)); + orchestrationRequests.infraActiveRequestLookup(iar.getRequestId()); + } + } |