yuluo-yx commented on code in PR #2426:
URL: https://github.com/apache/hertzbeat/pull/2426#discussion_r1701832041


##########
alerter/src/main/java/org/apache/hertzbeat/alert/controller/AlertDefinesController.java:
##########
@@ -111,8 +112,11 @@ public ResponseEntity<Message<Page<AlertDefine>>> 
getAlertDefines(
         };
         Sort sortExp = Sort.by(new 
Sort.Order(Sort.Direction.fromString(order), sort));
         PageRequest pageRequest = PageRequest.of(pageIndex, pageSize, sortExp);
+
         Page<AlertDefine> alertDefinePage = 
alertDefineService.getAlertDefines(specification, pageRequest);
-        return ResponseEntity.ok(Message.success(alertDefinePage));
+        Page<AlertDefine> alertDefinePages = new 
PageImpl<>(alertDefinePage.getContent(), pageRequest, 
alertDefinePage.getTotalElements());
+
+        return ResponseEntity.ok(Message.success(alertDefinePages));

Review Comment:
   The problem is due to the fact that it causes errors during testing, and I 
also found the same problem in another test class, so I did it this way
   
   but I didn't find out what the exact cause of the problem was, but this does 
fix the test questions. 😢



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to