@@ -266,12 +266,12 @@ protected void injectMockito() {
266266 hosts .add (this .host );
267267 Mockito .when (resourceMgr .listAllUpAndEnabledHosts ((Type ) Mockito .any (), Mockito .anyLong (), Mockito .anyLong (), Mockito .anyLong ())).thenReturn (hosts );
268268
269- remoteEp = RemoteHostEndPoint .getHypervisorHostEndPoint (this .host .getId (), this .host .getPrivateIpAddress ());
269+ remoteEp = RemoteHostEndPoint .getHypervisorHostEndPoint (this .host .getId (), this .host .getPrivateIpAddress (), this . host . getPublicIpAddress () );
270270 Mockito .when (epSelector .select (Mockito .any (DataObject .class ), Mockito .any (DataObject .class ))).thenReturn (remoteEp );
271271 Mockito .when (epSelector .select (Mockito .any (DataObject .class ))).thenReturn (remoteEp );
272272 Mockito .when (epSelector .select (Mockito .any (DataStore .class ))).thenReturn (remoteEp );
273273 Mockito .when (hyGuruMgr .getGuruProcessedCommandTargetHost (Mockito .anyLong (), Mockito .any (Command .class ))).thenReturn (this .host .getId ());
274-
274+
275275 }
276276
277277 public DataStore createPrimaryDataStore () {
@@ -333,7 +333,7 @@ private SnapshotVO createSnapshotInDb(VolumeInfo volume) {
333333 }
334334
335335 private VolumeVO createVolume (Long templateId , long dataStoreId ) {
336-
336+
337337 VolumeVO volume = new VolumeVO (Volume .Type .DATADISK , UUID .randomUUID ().toString (), this .dcId , 1L , 1L , 1L , 1000 );
338338 volume .setDataCenterId (this .dcId );
339339 volume .setPoolId (dataStoreId );
@@ -376,18 +376,18 @@ public void createSnapshot() {
376376 }
377377 }
378378 AssertJUnit .assertNotNull (newSnapshot );
379-
379+
380380 LocalHostEndpoint ep = new MockLocalHostEndPoint ();
381381 ep .setResource (new MockLocalNfsSecondaryStorageResource ());
382382 Mockito .when (epSelector .select (Mockito .any (DataStore .class ))).thenReturn (ep );
383-
383+
384384 //delete snapshot
385385 for (SnapshotStrategy strategy : this .snapshotStrategies ) {
386386 if (strategy .canHandle (snapshot )) {
387387 strategy .deleteSnapshot (newSnapshot .getId ());
388388 }
389389 }
390-
390+
391391 Mockito .when (epSelector .select (Mockito .any (DataStore .class ))).thenReturn (remoteEp );
392392 }
393393
@@ -412,7 +412,7 @@ private VMTemplateVO createTemplateInDb() {
412412 image = imageDataDao .persist (image );
413413 return image ;
414414 }
415-
415+
416416 @ Test
417417 public void createVolumeFromSnapshot () {
418418 VolumeInfo vol = createCopyBaseImage ();
@@ -432,7 +432,7 @@ public void createVolumeFromSnapshot() {
432432 VolumeInfo newVol = this .volFactory .getVolume (volVO .getId ());
433433 this .volumeService .createVolumeFromSnapshot (newVol , newVol .getDataStore (), snapshot );
434434 }
435-
435+
436436 @ Test
437437 public void deleteSnapshot () {
438438 VolumeInfo vol = createCopyBaseImage ();
@@ -445,14 +445,14 @@ public void deleteSnapshot() {
445445 }
446446 }
447447 AssertJUnit .assertNotNull (newSnapshot );
448-
448+
449449 //create another snapshot
450450 for (SnapshotStrategy strategy : this .snapshotStrategies ) {
451451 if (strategy .canHandle (snapshot )) {
452452 strategy .deleteSnapshot (newSnapshot .getId ());
453453 }
454454 }
455-
455+
456456 }
457457
458458 @ Test
@@ -477,6 +477,6 @@ public void createTemplateFromSnapshot() {
477477 DataStore imageStore = this .dataStoreMgr .getImageStore (this .dcId );
478478 this .imageService .createTemplateFromSnapshotAsync (snapshot , tmpl , imageStore );
479479 }
480-
481-
480+
481+
482482}
0 commit comments