aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xserver/src/main/java/org/onap/usecaseui/server/controller/AlarmController.java8
-rwxr-xr-xserver/src/test/java/org/onap/usecaseui/server/controller/AlarmControllerTest.java4
2 files changed, 6 insertions, 6 deletions
diff --git a/server/src/main/java/org/onap/usecaseui/server/controller/AlarmController.java b/server/src/main/java/org/onap/usecaseui/server/controller/AlarmController.java
index 1a032c48..091df4a9 100755
--- a/server/src/main/java/org/onap/usecaseui/server/controller/AlarmController.java
+++ b/server/src/main/java/org/onap/usecaseui/server/controller/AlarmController.java
@@ -105,13 +105,13 @@ public class AlarmController
public String getAlarmData(@PathVariable(required = false) String sourceName,
@PathVariable(required = false) String priority,@PathVariable(required = false) String startTime,
@PathVariable(required = false) String endTime,@PathVariable(required = false) String vfStatus,
- @PathVariable int currentPage, @PathVariable int pageSize) throws JsonProcessingException, ParseException {
+ @PathVariable String currentPage, @PathVariable String pageSize) throws JsonProcessingException, ParseException {
AlarmsHeader alarm = new AlarmsHeader();
alarm.setSourceName(sourceName);
alarm.setStatus(vfStatus);
- alarm.setStartEpochMicrosec(UuiCommonUtil.isNotNullOrEmpty(startTime)?null:new SimpleDateFormat(Constant.DATE_FORMAT).parse(startTime).getTime()+"");
- alarm.setLastEpochMicroSec(UuiCommonUtil.isNotNullOrEmpty(endTime)?null:new SimpleDateFormat(Constant.DATE_FORMAT).parse(endTime).getTime()+"");
- Page pa = alarmsHeaderService.queryAlarmsHeader(alarm,currentPage,pageSize);
+ alarm.setStartEpochMicrosec(!UuiCommonUtil.isNotNullOrEmpty(startTime)?null:new SimpleDateFormat(Constant.DATE_FORMAT).parse(startTime).getTime()+"");
+ alarm.setLastEpochMicroSec(!UuiCommonUtil.isNotNullOrEmpty(endTime)?null:new SimpleDateFormat(Constant.DATE_FORMAT).parse(endTime).getTime()+"");
+ Page pa = alarmsHeaderService.queryAlarmsHeader(alarm,Integer.parseInt(currentPage),Integer.parseInt(pageSize));
try {
Map<String,Object> map = new HashMap<>();
map.put("alarms",pa.getList());
diff --git a/server/src/test/java/org/onap/usecaseui/server/controller/AlarmControllerTest.java b/server/src/test/java/org/onap/usecaseui/server/controller/AlarmControllerTest.java
index 0054ab10..3bce961d 100755
--- a/server/src/test/java/org/onap/usecaseui/server/controller/AlarmControllerTest.java
+++ b/server/src/test/java/org/onap/usecaseui/server/controller/AlarmControllerTest.java
@@ -60,8 +60,8 @@ public class AlarmControllerTest {
@Test
public void testGetAlarmData() throws Exception {
try {
- controller.getAlarmData("sourceName", "priority", "startTime", "endTime", "vfStatus", 1, 10);
- controller.getAlarmData(null, null, null, null, null, 1, 10);
+ controller.getAlarmData("sourceName", "priority", "startTime", "endTime", "vfStatus", "1", "10");
+ controller.getAlarmData(null, null, null, null, null, "1", "10");
} catch (Exception e) {
e.printStackTrace();
}