aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKalkere Ramesh, Sharan (sk720x) <sk720x@att.com>2018-12-11 11:58:18 -0500
committerBenjamin, Max (mb388a) <mb388a@us.att.com>2019-01-03 23:52:05 -0500
commite9ce2038f8aaffaa021bf83524bdb5de248de167 (patch)
treeabd1c2a7f3f0b337422b29f6d71490eb0329b6b0
parent85a47c701c3b34c58d2b121ba466d41ffb4fb7b0 (diff)
Added timeStamp to requestStatus returned
Added timeStamp to requestStatus returned Change-Id: Ife220b95287e672f456f1511f64ddccb613dde93 Issue-ID: SO-1328 Signed-off-by: Kalkere Ramesh, Sharan (sk720x) <sk720x@att.com>
-rw-r--r--common/src/main/java/org/onap/so/serviceinstancebeans/RequestStatus.java9
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/OrchestrationRequests.java4
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/OrchestrationRequestsTest.java15
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/resources/OrchestrationRequest/OrchestrationFilterResponse.json12
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/resources/OrchestrationRequest/OrchestrationList.json9
5 files changed, 37 insertions, 12 deletions
diff --git a/common/src/main/java/org/onap/so/serviceinstancebeans/RequestStatus.java b/common/src/main/java/org/onap/so/serviceinstancebeans/RequestStatus.java
index 527aa037ed..8adce38ada 100644
--- a/common/src/main/java/org/onap/so/serviceinstancebeans/RequestStatus.java
+++ b/common/src/main/java/org/onap/so/serviceinstancebeans/RequestStatus.java
@@ -31,6 +31,7 @@ public class RequestStatus {
protected String statusMessage;
protected Integer percentProgress;
protected String finishTime;
+ protected String timeStamp;
public String getRequestState() {
@@ -57,9 +58,15 @@ public class RequestStatus {
public void setFinishTime(String finishTime) {
this.finishTime = finishTime;
}
+ public String getTimeStamp() {
+ return timeStamp;
+ }
+ public void setTimeStamp(String timeStamp) {
+ this.timeStamp = timeStamp;
+ }
@Override
public String toString() {
return new ToStringBuilder(this).append("requestState", requestState).append("statusMessage", statusMessage)
- .append("percentProgress", percentProgress).append("finishTime", finishTime).toString();
+ .append("percentProgress", percentProgress).append("finishTime", finishTime).append("timeStamp", timeStamp).toString();
}
}
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"
}
}
}