aboutsummaryrefslogtreecommitdiffstats
path: root/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap
diff options
context:
space:
mode:
authorSteve Smokowski <ss835w@att.com>2019-06-07 17:38:55 +0000
committerGerrit Code Review <gerrit@onap.org>2019-06-07 17:38:55 +0000
commit945d4522d6433c2a458975dcad867ee8c27ca2d9 (patch)
treeae8056acfb73ec980d67603acad5112d946a8a8a /mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap
parent1196db4be81e49b8282908e76c6f0f72a29ccb9f (diff)
parent65ca9cb2cc392dcd9793f7758d9d1fd0dd592fb7 (diff)
Merge "resume request support"
Diffstat (limited to 'mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap')
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/RequestHandlerUtilsUnitTest.java18
1 files changed, 14 insertions, 4 deletions
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/RequestHandlerUtilsUnitTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/RequestHandlerUtilsUnitTest.java
index e92417728c..3cb4e0c9c2 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/RequestHandlerUtilsUnitTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/RequestHandlerUtilsUnitTest.java
@@ -114,14 +114,14 @@ public class RequestHandlerUtilsUnitTest {
currentActiveRequest.setSource("VID");
currentActiveRequest.setStartTime(startTimeStamp);
currentActiveRequest.setTenantId("tenant-id");
- currentActiveRequest.setRequestBody(getRequestBody("/RequestBody.json"));
+ currentActiveRequest.setRequestBody(getRequestBody("/RequestBodyNewRequestorId.json"));
currentActiveRequest.setAicCloudRegion("cloudRegion");
currentActiveRequest.setRequestScope("service");
currentActiveRequest.setRequestStatus(Status.IN_PROGRESS.toString());
currentActiveRequest.setLastModifiedBy(Constants.MODIFIED_BY_APIHANDLER);
currentActiveRequest.setRequestAction(Action.createInstance.toString());
currentActiveRequest.setRequestUrl(requestUri);
- currentActiveRequest.setRequestorId("xxxxxx");
+ currentActiveRequest.setRequestorId("yyyyyy");
currentActiveRequest.setProgress(new Long(5));
currentActiveRequest.setOriginalRequestId(RESUMED_REQUEST_ID);
}
@@ -140,10 +140,12 @@ public class RequestHandlerUtilsUnitTest {
@Test
- public void createNewRecordCopyFromInfraActiveRequestTest() {
+ public void createNewRecordCopyFromInfraActiveRequestTest() throws IOException {
doNothing().when(requestHandler).setInstanceIdAndName(infraActiveRequest, currentActiveRequest);
+ doReturn(getRequestBody("/RequestBodyNewRequestorId.json")).when(requestHandler)
+ .updateRequestorIdInRequestBody(infraActiveRequest, "yyyyyy");
InfraActiveRequests result = requestHandler.createNewRecordCopyFromInfraActiveRequest(infraActiveRequest,
- CURRENT_REQUEST_ID, startTimeStamp, "VID", requestUri, "xxxxxx", RESUMED_REQUEST_ID);
+ CURRENT_REQUEST_ID, startTimeStamp, "VID", requestUri, "yyyyyy", RESUMED_REQUEST_ID);
assertThat(currentActiveRequest, sameBeanAs(result));
}
@@ -396,4 +398,12 @@ public class RequestHandlerUtilsUnitTest {
assertEquals(modelTypeResult, modelTypeExpected);
}
+ @Test
+ public void updateRequestorIdInRequestBodyTest() throws IOException {
+ String newRequestorId = "yyyyyy";
+ String expected = getRequestBody("/RequestBodyNewRequestorId.json");
+ String result = requestHandler.updateRequestorIdInRequestBody(infraActiveRequest, newRequestorId);
+ assertEquals(expected, result);
+ }
+
}