vishesh92 commented on code in PR #7997:
URL: https://github.com/apache/cloudstack/pull/7997#discussion_r1335628515


##########
server/src/test/java/com/cloud/resourcelimit/CheckedReservationTest.java:
##########
@@ -70,14 +72,16 @@ public void tearDown() throws Exception {
     @Test
     public void getId() {
         when(account.getDomainId()).thenReturn(4l);
-        boolean fail = false;
-        try (CheckedReservation cr = new CheckedReservation(account, 
Resource.ResourceType.user_vm,1l, reservationDao, resourceLimitService); ) {
+        // Some weird behaviour depending on whether the database is up or not.
+        
lenient().when(reservationDao.persist(Mockito.any())).thenReturn(reservation);

Review Comment:
   Added lenient because if the database is up, this show up as unused stubs.



##########
server/src/test/java/com/cloud/resourcelimit/CheckedReservationTest.java:
##########
@@ -70,14 +72,16 @@ public void tearDown() throws Exception {
     @Test
     public void getId() {
         when(account.getDomainId()).thenReturn(4l);
-        boolean fail = false;
-        try (CheckedReservation cr = new CheckedReservation(account, 
Resource.ResourceType.user_vm,1l, reservationDao, resourceLimitService); ) {
+        // Some weird behaviour depending on whether the database is up or not.
+        
lenient().when(reservationDao.persist(Mockito.any())).thenReturn(reservation);

Review Comment:
   Added lenient because if the database is not up, this show up as unused 
stubs.



-- 
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]

Reply via email to