Skip to content

Commit 1e1e7a9

Browse files
committed
fix tests
1 parent 5db5dd9 commit 1e1e7a9

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

engine/storage/snapshot/src/test/java/org/apache/cloudstack/storage/snapshot/DefaultSnapshotStrategyTest.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -257,11 +257,6 @@ public void verifyIfTheSnapshotIsBeingUsedByAnyVolumeTestDetailsIsNotEmptyThrowC
257257

258258
@Test
259259
public void testGetSnapshotImageStoreRefNull() {
260-
SnapshotDataStoreVO ref1 = Mockito.mock(SnapshotDataStoreVO.class);
261-
Mockito.when(ref1.getDataStoreId()).thenReturn(1L);
262-
Mockito.when(ref1.getRole()).thenReturn(DataStoreRole.Image);
263-
Mockito.when(snapshotDataStoreDao.listReadyBySnapshot(Mockito.anyLong(), Mockito.any(DataStoreRole.class))).thenReturn(List.of(ref1));
264-
Mockito.when(dataStoreManager.getStoreZoneId(1L, DataStoreRole.Image)).thenReturn(2L);
265260
Assert.assertNull(defaultSnapshotStrategySpy.getSnapshotImageStoreRef(1L, 1L));
266261
}
267262

@@ -270,7 +265,7 @@ public void testGetSnapshotImageStoreRefNotNull() {
270265
SnapshotDataStoreVO ref1 = Mockito.mock(SnapshotDataStoreVO.class);
271266
Mockito.when(ref1.getDataStoreId()).thenReturn(1L);
272267
Mockito.when(ref1.getRole()).thenReturn(DataStoreRole.Image);
273-
Mockito.when(snapshotDataStoreDao.listReadyBySnapshot(Mockito.anyLong(), Mockito.any(DataStoreRole.class))).thenReturn(List.of(ref1));
268+
Mockito.when(snapshotDataStoreDao.findBySnapshotIdAndDataStoreRoleAndStateIn(Mockito.anyLong(), Mockito.any(DataStoreRole.class), Mockito.any(), Mockito.any())).thenReturn(List.of(ref1));
274269
Mockito.when(dataStoreManager.getStoreZoneId(1L, DataStoreRole.Image)).thenReturn(1L);
275270
Assert.assertNotNull(defaultSnapshotStrategySpy.getSnapshotImageStoreRef(1L, 1L));
276271
}

0 commit comments

Comments
 (0)