@@ -151,6 +151,8 @@ public class HypervisorTemplateAdapterTest {
151151
152152 private AutoCloseable closeable ;
153153
154+ private static final long zoneId = 1L ;
155+
154156 @ Before
155157 public void before () {
156158 closeable = MockitoAnnotations .openMocks (this );
@@ -323,7 +325,6 @@ public void createTemplateWithinZonesTestZoneIdsNullShouldCallListAllZones() {
323325 VMTemplateVO vmTemplateVOMock = Mockito .mock (VMTemplateVO .class );
324326
325327 Mockito .when (templateProfileMock .getZoneIdList ()).thenReturn (null );
326- Mockito .doReturn (null ).when (_adapter ).getImageStoresThrowsExceptionIfNotFound (Mockito .any (List .class ), Mockito .any (TemplateProfile .class ));
327328
328329 _adapter .createTemplateWithinZones (templateProfileMock , vmTemplateVOMock );
329330
@@ -337,7 +338,7 @@ public void createTemplateWithinZonesTestZoneIdsNotNullShouldNotCallListAllZones
337338 List <Long > zoneIds = List .of (1L );
338339
339340 Mockito .when (templateProfileMock .getZoneIdList ()).thenReturn (zoneIds );
340- Mockito .doReturn (null ).when (_adapter ).getImageStoresThrowsExceptionIfNotFound (Mockito .any (List .class ), Mockito .any (TemplateProfile .class ));
341+ Mockito .doReturn (null ).when (_adapter ).getImageStoresThrowsExceptionIfNotFound (Mockito .any (Long .class ), Mockito .any (TemplateProfile .class ));
341342 Mockito .doReturn (null ).when (_adapter ).verifyHeuristicRulesForZone (Mockito .any (VMTemplateVO .class ), Mockito .anyLong ());
342343 Mockito .doNothing ().when (_adapter ).standardImageStoreAllocation (Mockito .isNull (), Mockito .any (VMTemplateVO .class ));
343344
@@ -350,10 +351,10 @@ public void createTemplateWithinZonesTestZoneIdsNotNullShouldNotCallListAllZones
350351 public void createTemplateWithinZonesTestZoneDoesNotHaveActiveHeuristicRulesShouldCallStandardImageStoreAllocation () {
351352 TemplateProfile templateProfileMock = Mockito .mock (TemplateProfile .class );
352353 VMTemplateVO vmTemplateVOMock = Mockito .mock (VMTemplateVO .class );
353- List <Long > zoneIds = List .of (1L );
354+ List <Long > zoneIds = List .of (zoneId );
354355
355356 Mockito .when (templateProfileMock .getZoneIdList ()).thenReturn (zoneIds );
356- Mockito .doReturn (null ).when (_adapter ).getImageStoresThrowsExceptionIfNotFound (Mockito .any (List .class ), Mockito .any (TemplateProfile .class ));
357+ Mockito .doReturn (null ).when (_adapter ).getImageStoresThrowsExceptionIfNotFound (Mockito .any (Long .class ), Mockito .any (TemplateProfile .class ));
357358 Mockito .doReturn (null ).when (_adapter ).verifyHeuristicRulesForZone (Mockito .any (VMTemplateVO .class ), Mockito .anyLong ());
358359 Mockito .doNothing ().when (_adapter ).standardImageStoreAllocation (Mockito .isNull (), Mockito .any (VMTemplateVO .class ));
359360
@@ -370,7 +371,6 @@ public void createTemplateWithinZonesTestZoneWithHeuristicRuleShouldCallValidate
370371 List <Long > zoneIds = List .of (1L );
371372
372373 Mockito .when (templateProfileMock .getZoneIdList ()).thenReturn (zoneIds );
373- Mockito .doReturn (null ).when (_adapter ).getImageStoresThrowsExceptionIfNotFound (Mockito .any (List .class ), Mockito .any (TemplateProfile .class ));
374374 Mockito .doReturn (dataStoreMock ).when (_adapter ).verifyHeuristicRulesForZone (Mockito .any (VMTemplateVO .class ), Mockito .anyLong ());
375375 Mockito .doNothing ().when (_adapter ).validateSecondaryStorageAndCreateTemplate (Mockito .any (List .class ), Mockito .any (VMTemplateVO .class ), Mockito .isNull ());
376376
@@ -382,34 +382,31 @@ public void createTemplateWithinZonesTestZoneWithHeuristicRuleShouldCallValidate
382382 @ Test (expected = CloudRuntimeException .class )
383383 public void getImageStoresThrowsExceptionIfNotFoundTestNullImageStoreShouldThrowCloudRuntimeException () {
384384 TemplateProfile templateProfileMock = Mockito .mock (TemplateProfile .class );
385- List <Long > zoneIds = List .of (1L );
386385
387386 Mockito .when (dataStoreManagerMock .getImageStoresByZoneIds (Mockito .anyLong ())).thenReturn (null );
388387
389- _adapter .getImageStoresThrowsExceptionIfNotFound (zoneIds , templateProfileMock );
388+ _adapter .getImageStoresThrowsExceptionIfNotFound (zoneId , templateProfileMock );
390389 }
391390
392391 @ Test (expected = CloudRuntimeException .class )
393392 public void getImageStoresThrowsExceptionIfNotFoundTestEmptyImageStoreShouldThrowCloudRuntimeException () {
394393 TemplateProfile templateProfileMock = Mockito .mock (TemplateProfile .class );
395- List <Long > zoneIds = List .of (1L );
396394 List <DataStore > imageStoresList = new ArrayList <>();
397395
398396 Mockito .when (dataStoreManagerMock .getImageStoresByZoneIds (Mockito .anyLong ())).thenReturn (imageStoresList );
399397
400- _adapter .getImageStoresThrowsExceptionIfNotFound (zoneIds , templateProfileMock );
398+ _adapter .getImageStoresThrowsExceptionIfNotFound (zoneId , templateProfileMock );
401399 }
402400
403401 @ Test
404402 public void getImageStoresThrowsExceptionIfNotFoundTestNonEmptyImageStoreShouldNotThrowCloudRuntimeException () {
405403 TemplateProfile templateProfileMock = Mockito .mock (TemplateProfile .class );
406- List <Long > zoneIds = List .of (1L );
407404 DataStore dataStoreMock = Mockito .mock (DataStore .class );
408405 List <DataStore > imageStoresList = List .of (dataStoreMock );
409406
410407 Mockito .when (dataStoreManagerMock .getImageStoresByZoneIds (Mockito .anyLong ())).thenReturn (imageStoresList );
411408
412- _adapter .getImageStoresThrowsExceptionIfNotFound (zoneIds , templateProfileMock );
409+ _adapter .getImageStoresThrowsExceptionIfNotFound (zoneId , templateProfileMock );
413410 }
414411
415412 @ Test
0 commit comments