Copilot commented on code in PR #12232:
URL: https://github.com/apache/cloudstack/pull/12232#discussion_r2607689223
##########
server/src/test/java/com/cloud/hypervisor/KVMGuruTest.java:
##########
@@ -141,10 +141,12 @@ public void testSetVmQuotaPercentage() {
Mockito.verify(vmTO).setCpuQuotaPercentage(Mockito.anyDouble());
}
- @Test(expected = CloudRuntimeException.class)
+ @Test
public void testSetVmQuotaPercentageNullHost() {
Mockito.when(hostDao.findById(hostId)).thenReturn(null);
+ Mockito.when(vm.getLastHostId()).thenReturn(null);
Review Comment:
This mock setup for `vm.getLastHostId()` is unnecessary. The
`setVmQuotaPercentage` method only calls `vm.getHostId()` (line 133 in
KVMGuru.java) and does not use `getLastHostId()`. Consider removing this line
to keep the test clean and focused.
```suggestion
```
--
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]