Copilot commented on code in PR #12994:
URL: https://github.com/apache/cloudstack/pull/12994#discussion_r3062846006


##########
server/src/test/java/org/apache/cloudstack/cluster/ClusterDrsServiceImplTest.java:
##########
@@ -121,6 +123,9 @@ public class ClusterDrsServiceImplTest {
     @Mock
     private AffinityGroupVMMapDao affinityGroupVMMapDao;
 
+    @Mock
+    private UserVmDetailsDao userVmDetailsDao;
+

Review Comment:
   The new `userVmDetailsDao` mock is not stubbed in `setUp()` (or in most 
tests). Since `getDrsPlan()` now always calls 
`userVmDetailsDao.listDetailsForResourceIdsAndKey(...).stream()`, Mockito will 
return `null` by default and these tests will NPE. Add a default stub (e.g., 
return an empty list) in `setUp()` or in each test that calls `getDrsPlan()` 
and doesn’t explicitly set SKIP_DRS details.



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