diff options
Diffstat (limited to 'mso-api-handlers/mso-api-handler-infra/src')
4 files changed, 29 insertions, 11 deletions
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/OrchestrationRequests.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/OrchestrationRequests.java index c809079acf..a7c25fab68 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/OrchestrationRequests.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/OrchestrationRequests.java @@ -363,6 +363,10 @@ public class OrchestrationRequests { String endTimeStamp = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss").format(iar.getEndTime()) + " GMT"; status.setFinishTime(endTimeStamp); } + if(iar.getModifyTime() != null){ + String timeStamp = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss").format(iar.getModifyTime()) + " GMT"; + status.setTimeStamp(timeStamp); + } if(iar.getRequestStatus() != null){ 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 b2e221ac7b..4a6a59bebb 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 @@ -118,7 +118,8 @@ public class OrchestrationRequestsTest extends BaseTest { assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); assertThat(response.getBody(), - sameBeanAs(testResponse).ignoring("request.startTime").ignoring("request.requestStatus.finishTime")); + sameBeanAs(testResponse).ignoring("request.startTime").ignoring("request.requestStatus.finishTime") + .ignoring("request.requestStatus.timeStamp")); assertEquals("application/json", response.getHeaders().get(HttpHeaders.CONTENT_TYPE).get(0)); assertEquals("0", response.getHeaders().get("X-MinorVersion").get(0)); assertEquals("0", response.getHeaders().get("X-PatchVersion").get(0)); @@ -148,7 +149,9 @@ public class OrchestrationRequestsTest extends BaseTest { assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); assertThat(response.getBody(), - sameBeanAs(testResponse).ignoring("request.startTime").ignoring("request.requestStatus.finishTime")); + sameBeanAs(testResponse).ignoring("request.startTime") + .ignoring("request.requestStatus.finishTime") + .ignoring("request.requestStatus.timeStamp")); } @Test @@ -174,7 +177,9 @@ public class OrchestrationRequestsTest extends BaseTest { assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); assertThat(response.getBody(), - sameBeanAs(testResponse).ignoring("request.startTime").ignoring("request.requestStatus.finishTime")); + sameBeanAs(testResponse).ignoring("request.startTime") + .ignoring("request.requestStatus.finishTime") + .ignoring("request.requestStatus.timeStamp")); assertEquals("application/json", response.getHeaders().get(HttpHeaders.CONTENT_TYPE).get(0)); assertEquals("0", response.getHeaders().get("X-MinorVersion").get(0)); assertEquals("0", response.getHeaders().get("X-PatchVersion").get(0)); @@ -222,7 +227,9 @@ public class OrchestrationRequestsTest extends BaseTest { ResponseEntity<GetOrchestrationListResponse> response = restTemplate.exchange(builder.toUriString(), HttpMethod.GET, entity, GetOrchestrationListResponse.class); assertThat(response.getBody(), - sameBeanAs(testResponse).ignoring("requestList.request.startTime").ignoring("requestList.request.requestStatus.finishTime")); + sameBeanAs(testResponse).ignoring("requestList.request.startTime") + .ignoring("requestList.request.requestStatus.finishTime") + .ignoring("requestList.request.requestStatus.timeStamp")); assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); assertEquals(requests.size(), response.getBody().getRequestList().size()); diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/OrchestrationRequest/OrchestrationFilterResponse.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/OrchestrationRequest/OrchestrationFilterResponse.json index 051ac16d77..a092650664 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/OrchestrationRequest/OrchestrationFilterResponse.json +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/OrchestrationRequest/OrchestrationFilterResponse.json @@ -29,7 +29,8 @@ "requestState": "COMPLETE", "statusMessage": "STATUS: COMPLETED", "percentProgress": 100, - "finishTime": "Tue, 02 May 2017 06:33:34 GMT" + "finishTime": "Tue, 02 May 2017 06:33:34 GMT", + "timeStamp": "Fri, 01 Jul 2016 04:41:42 GMT" } } }, @@ -63,7 +64,8 @@ "requestState": "COMPLETE", "statusMessage": "STATUS: Vf Module has been deleted successfully./FLOW STATUS: Building blocks 1 of 3 completed./ROLLBACK STATUS: Rollback has been completed successfully.", "percentProgress": 100, - "finishTime": "Thu, 22 Dec 2016 08:30:28 GMT" + "finishTime": "Thu, 22 Dec 2016 08:30:28 GMT", + "timeStamp": "Thu, 22 Dec 2016 08:30:28 GMT" } } }, @@ -97,7 +99,8 @@ "requestState": "PENDING", "statusMessage": "STATUS: Vf Module deletion pending.", "percentProgress": 0, - "finishTime": "Thu, 22 Dec 2016 08:30:28 GMT" + "finishTime": "Thu, 22 Dec 2016 08:30:28 GMT", + "timeStamp": "Thu, 22 Dec 2016 08:30:28 GMT" } } }, @@ -181,7 +184,8 @@ "requestState": "UNLOCKED", "statusMessage": "STATUS: Vf Module deletion pending.", "percentProgress": 0, - "finishTime": "Thu, 22 Dec 2016 08:30:28 GMT" + "finishTime": "Thu, 22 Dec 2016 08:30:28 GMT", + "timeStamp": "Mon, 30 Jul 2018 06:09:01 GMT" } } } diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/OrchestrationRequest/OrchestrationList.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/OrchestrationRequest/OrchestrationList.json index 4ed5ffeb08..12e2417357 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/OrchestrationRequest/OrchestrationList.json +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/OrchestrationRequest/OrchestrationList.json @@ -27,7 +27,8 @@ "requestStatus":{ "requestState":"COMPLETE", "statusMessage":"STATUS: Vf Module has been deleted successfully.", - "percentProgress":100 + "percentProgress":100, + "timeStamp": "Thu, 22 Dec 2016 08:30:28 GMT" } } }, @@ -58,7 +59,8 @@ "requestStatus":{ "requestState":"PENDING", "statusMessage":"STATUS: Vf Module deletion pending./FLOW STATUS: Building blocks 1 of 3 completed./RETRY STATUS: Retry 2/5 will be started in 8 min./ROLLBACK STATUS: Rollback has been completed successfully.", - "percentProgress":0 + "percentProgress":0, + "timeStamp": "Thu, 22 Dec 2016 08:30:28 GMT" } } }, @@ -320,7 +322,8 @@ "requestStatus":{ "requestState":"PENDING", "statusMessage":"STATUS: Adding members./FLOW STATUS: Building blocks 1 of 3 completed./RETRY STATUS: Retry 2/5 will be started in 8 min./ROLLBACK STATUS: Rollback has been completed successfully.", - "percentProgress":0 + "percentProgress":0, + "timeStamp": "Thu, 22 Dec 2016 08:30:28 GMT" } } } |