@@ -1735,9 +1735,9 @@ public void testCleanupSnapshotRecordsInPrimaryStorageOnly() {
17351735 Mockito .when (snapshot .getState ()).thenReturn (Snapshot .State .BackedUp );
17361736 Mockito .when (snapshotDao .listByVolumeId (1L )).thenReturn (List .of (snapshot ));
17371737
1738- SnapshotDataStoreVO primaryRef = Mockito .mock (SnapshotDataStoreVO .class );
1739- Mockito .when (primaryRef .getId ()).thenReturn (100L );
1740- Mockito .when (snapshotStoreDao .listBySnapshotAndDataStoreRole (10L , DataStoreRole .Primary )).thenReturn (List .of (primaryRef ));
1738+ SnapshotDataStoreVO snapshotOnPrimaryStorage = Mockito .mock (SnapshotDataStoreVO .class );
1739+ Mockito .when (snapshotOnPrimaryStorage .getId ()).thenReturn (100L );
1740+ Mockito .when (snapshotStoreDao .listBySnapshotAndDataStoreRole (10L , DataStoreRole .Primary )).thenReturn (List .of (snapshotOnPrimaryStorage ));
17411741 Mockito .when (snapshotStoreDao .listBySnapshotAndDataStoreRole (10L , DataStoreRole .Image )).thenReturn (Collections .emptyList ());
17421742
17431743 storageManagerImpl .cleanupSnapshotRecordsInPrimaryStorageOnly (volume );
@@ -1757,10 +1757,10 @@ public void testCleanupSnapshotRecordsInPrimaryStorageOnlySkipsWhenSecondaryExis
17571757 Mockito .when (snapshot .getState ()).thenReturn (Snapshot .State .BackedUp );
17581758 Mockito .when (snapshotDao .listByVolumeId (1L )).thenReturn (List .of (snapshot ));
17591759
1760- SnapshotDataStoreVO primaryRef = Mockito .mock (SnapshotDataStoreVO .class );
1761- SnapshotDataStoreVO secondaryRef = Mockito .mock (SnapshotDataStoreVO .class );
1762- Mockito .when (snapshotStoreDao .listBySnapshotAndDataStoreRole (10L , DataStoreRole .Primary )).thenReturn (List .of (primaryRef ));
1763- Mockito .when (snapshotStoreDao .listBySnapshotAndDataStoreRole (10L , DataStoreRole .Image )).thenReturn (List .of (secondaryRef ));
1760+ SnapshotDataStoreVO snapshotOnPrimaryStorage = Mockito .mock (SnapshotDataStoreVO .class );
1761+ SnapshotDataStoreVO snapshotOnSecondaryStorage = Mockito .mock (SnapshotDataStoreVO .class );
1762+ Mockito .when (snapshotStoreDao .listBySnapshotAndDataStoreRole (10L , DataStoreRole .Primary )).thenReturn (List .of (snapshotOnPrimaryStorage ));
1763+ Mockito .when (snapshotStoreDao .listBySnapshotAndDataStoreRole (10L , DataStoreRole .Image )).thenReturn (List .of (snapshotOnSecondaryStorage ));
17641764
17651765 storageManagerImpl .cleanupSnapshotRecordsInPrimaryStorageOnly (volume );
17661766
0 commit comments