Skip to content

Commit 9f4d61f

Browse files
committed
test(backup): drop unnecessary host.getId() stub in live-child delete test
The deleteWithLiveChildMarksDeletePendingAndPreservesFile test asserts no agent traffic (verified via agentManager.send is never called) because the live-child branch only writes a DELETE_PENDING tombstone in backup_details. host.getId() is therefore never invoked, so stubbing it triggered an UnnecessaryStubbingException under MockitoJUnitRunner's strict mode. Fixes the test error introduced in b7b74c4 and unblocks CI for #13074.
1 parent b7b74c4 commit 9f4d61f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

plugins/backup/nas/src/test/java/org/apache/cloudstack/backup/NASBackupProviderTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,8 @@ public void deleteWithLiveChildMarksDeletePendingAndPreservesFile()
468468
Mockito.when(vm.getLastHostId()).thenReturn(hostId);
469469
HostVO host = mock(HostVO.class);
470470
Mockito.when(host.getStatus()).thenReturn(Status.Up);
471-
Mockito.when(host.getId()).thenReturn(hostId);
471+
// Note: host.getId() is intentionally not stubbed — the live-child path never
472+
// contacts the agent (verified below), so the stub would be unnecessary.
472473
Mockito.when(hostDao.findById(hostId)).thenReturn(host);
473474

474475
BackupRepositoryVO repo = new BackupRepositoryVO(1L, "nas", "test-repo",

0 commit comments

Comments
 (0)