@@ -1455,11 +1455,11 @@ public void testRestoreVirtualMachineWithVMSnapshots() throws ResourceUnavailabl
14551455 }
14561456
14571457 @ Test
1458- public void updateInstanceDetailsKeepCurrentValueIfNullTestDetailsConstantIsNotNullDoNothing () {
1458+ public void addCurrentDetailValueToInstanceDetailsMapIfNewValueWasNotSpecifiedTestDetailsConstantIsNotNullDoNothing () {
14591459 int currentValue = 123 ;
14601460
14611461 for (String detailsConstant : detailsConstants ) {
1462- userVmManagerImpl .updateInstanceDetailsKeepCurrentValueIfNull (null , customParameters , detailsConstant , currentValue );
1462+ userVmManagerImpl .addCurrentDetailValueToInstanceDetailsMapIfNewValueWasNotSpecified (null , customParameters , detailsConstant , currentValue );
14631463 }
14641464
14651465 Assert .assertEquals (customParameters .get (VmDetailConstants .MEMORY ), "2048" );
@@ -1468,12 +1468,12 @@ public void updateInstanceDetailsKeepCurrentValueIfNullTestDetailsConstantIsNotN
14681468 }
14691469
14701470 @ Test
1471- public void updateInstanceDetailsKeepCurrentValueIfNullTestNewValueIsNotNullDoNothing () {
1471+ public void addCurrentDetailValueToInstanceDetailsMapIfNewValueWasNotSpecifiedTestNewValueIsNotNullDoNothing () {
14721472 Map <String , String > details = new HashMap <>();
14731473 int currentValue = 123 ;
14741474
14751475 for (String detailsConstant : detailsConstants ) {
1476- userVmManagerImpl .updateInstanceDetailsKeepCurrentValueIfNull (321 , details , detailsConstant , currentValue );
1476+ userVmManagerImpl .addCurrentDetailValueToInstanceDetailsMapIfNewValueWasNotSpecified (321 , details , detailsConstant , currentValue );
14771477 }
14781478
14791479 Assert .assertNull (details .get (VmDetailConstants .MEMORY ));
@@ -1482,12 +1482,12 @@ public void updateInstanceDetailsKeepCurrentValueIfNullTestNewValueIsNotNullDoNo
14821482 }
14831483
14841484 @ Test
1485- public void updateInstanceDetailsKeepCurrentValueIfNullTestBothValuesAreNullKeepCurrentValue () {
1485+ public void addCurrentDetailValueToInstanceDetailsMapIfNewValueWasNotSpecifiedTestBothValuesAreNullKeepCurrentValue () {
14861486 Map <String , String > details = new HashMap <>();
14871487 int currentValue = 123 ;
14881488
14891489 for (String detailsConstant : detailsConstants ) {
1490- userVmManagerImpl .updateInstanceDetailsKeepCurrentValueIfNull (null , details , detailsConstant , currentValue );
1490+ userVmManagerImpl .addCurrentDetailValueToInstanceDetailsMapIfNewValueWasNotSpecified (null , details , detailsConstant , currentValue );
14911491 }
14921492
14931493 Assert .assertEquals (details .get (VmDetailConstants .MEMORY ), String .valueOf (currentValue ));
@@ -1496,11 +1496,11 @@ public void updateInstanceDetailsKeepCurrentValueIfNullTestBothValuesAreNullKeep
14961496 }
14971497
14981498 @ Test
1499- public void updateInstanceDetailsKeepCurrentValueIfNullTestNeitherValueIsNullDoNothing () {
1499+ public void addCurrentDetailValueToInstanceDetailsMapIfNewValueWasNotSpecifiedTestNeitherValueIsNullDoNothing () {
15001500 int currentValue = 123 ;
15011501
15021502 for (String detailsConstant : detailsConstants ) {
1503- userVmManagerImpl .updateInstanceDetailsKeepCurrentValueIfNull (321 , customParameters , detailsConstant , currentValue );
1503+ userVmManagerImpl .addCurrentDetailValueToInstanceDetailsMapIfNewValueWasNotSpecified (321 , customParameters , detailsConstant , currentValue );
15041504 }
15051505
15061506 Assert .assertEquals (customParameters .get (VmDetailConstants .MEMORY ), "2048" );
@@ -1509,16 +1509,16 @@ public void updateInstanceDetailsKeepCurrentValueIfNullTestNeitherValueIsNullDoN
15091509 }
15101510
15111511 @ Test
1512- public void updateInstanceDetailsTestAllConstantsAreUpdated () {
1512+ public void updateInstanceDetailsMapWithCurrentValuesForAbsentDetailsTestAllConstantsAreUpdated () {
15131513 Mockito .doReturn (serviceOffering ).when (_serviceOfferingDao ).findById (Mockito .anyLong ());
15141514 Mockito .doReturn (1L ).when (vmInstanceMock ).getId ();
15151515 Mockito .doReturn (1L ).when (vmInstanceMock ).getServiceOfferingId ();
15161516 Mockito .doReturn (serviceOffering ).when (_serviceOfferingDao ).findByIdIncludingRemoved (Mockito .anyLong (), Mockito .anyLong ());
1517- userVmManagerImpl .updateInstanceDetails (null , vmInstanceMock , 0l );
1517+ userVmManagerImpl .updateInstanceDetailsMapWithCurrentValuesForAbsentDetails (null , vmInstanceMock , 0l );
15181518
1519- Mockito .verify (userVmManagerImpl ).updateInstanceDetailsKeepCurrentValueIfNull (Mockito .any (), Mockito .any (), Mockito .eq (VmDetailConstants .CPU_SPEED ), Mockito .any ());
1520- Mockito .verify (userVmManagerImpl ).updateInstanceDetailsKeepCurrentValueIfNull (Mockito .any (), Mockito .any (), Mockito .eq (VmDetailConstants .MEMORY ), Mockito .any ());
1521- Mockito .verify (userVmManagerImpl ).updateInstanceDetailsKeepCurrentValueIfNull (Mockito .any (), Mockito .any (), Mockito .eq (VmDetailConstants .CPU_NUMBER ), Mockito .any ());
1519+ Mockito .verify (userVmManagerImpl ).addCurrentDetailValueToInstanceDetailsMapIfNewValueWasNotSpecified (Mockito .any (), Mockito .any (), Mockito .eq (VmDetailConstants .CPU_SPEED ), Mockito .any ());
1520+ Mockito .verify (userVmManagerImpl ).addCurrentDetailValueToInstanceDetailsMapIfNewValueWasNotSpecified (Mockito .any (), Mockito .any (), Mockito .eq (VmDetailConstants .MEMORY ), Mockito .any ());
1521+ Mockito .verify (userVmManagerImpl ).addCurrentDetailValueToInstanceDetailsMapIfNewValueWasNotSpecified (Mockito .any (), Mockito .any (), Mockito .eq (VmDetailConstants .CPU_NUMBER ), Mockito .any ());
15221522 }
15231523
15241524 @ Test
0 commit comments