@@ -1454,11 +1454,11 @@ public void testRestoreVirtualMachineWithVMSnapshots() throws ResourceUnavailabl
14541454 }
14551455
14561456 @ Test
1457- public void updateInstanceDetailsKeepCurrentValueIfNullTestDetailsConstantIsNotNullDoNothing () {
1457+ public void addCurrentDetailValueToInstanceDetailsMapIfNewValueWasNotSpecifiedTestDetailsConstantIsNotNullDoNothing () {
14581458 int currentValue = 123 ;
14591459
14601460 for (String detailsConstant : detailsConstants ) {
1461- userVmManagerImpl .updateInstanceDetailsKeepCurrentValueIfNull (null , customParameters , detailsConstant , currentValue );
1461+ userVmManagerImpl .addCurrentDetailValueToInstanceDetailsMapIfNewValueWasNotSpecified (null , customParameters , detailsConstant , currentValue );
14621462 }
14631463
14641464 Assert .assertEquals (customParameters .get (VmDetailConstants .MEMORY ), "2048" );
@@ -1467,12 +1467,12 @@ public void updateInstanceDetailsKeepCurrentValueIfNullTestDetailsConstantIsNotN
14671467 }
14681468
14691469 @ Test
1470- public void updateInstanceDetailsKeepCurrentValueIfNullTestNewValueIsNotNullDoNothing () {
1470+ public void addCurrentDetailValueToInstanceDetailsMapIfNewValueWasNotSpecifiedTestNewValueIsNotNullDoNothing () {
14711471 Map <String , String > details = new HashMap <>();
14721472 int currentValue = 123 ;
14731473
14741474 for (String detailsConstant : detailsConstants ) {
1475- userVmManagerImpl .updateInstanceDetailsKeepCurrentValueIfNull (321 , details , detailsConstant , currentValue );
1475+ userVmManagerImpl .addCurrentDetailValueToInstanceDetailsMapIfNewValueWasNotSpecified (321 , details , detailsConstant , currentValue );
14761476 }
14771477
14781478 Assert .assertNull (details .get (VmDetailConstants .MEMORY ));
@@ -1481,12 +1481,12 @@ public void updateInstanceDetailsKeepCurrentValueIfNullTestNewValueIsNotNullDoNo
14811481 }
14821482
14831483 @ Test
1484- public void updateInstanceDetailsKeepCurrentValueIfNullTestBothValuesAreNullKeepCurrentValue () {
1484+ public void addCurrentDetailValueToInstanceDetailsMapIfNewValueWasNotSpecifiedTestBothValuesAreNullKeepCurrentValue () {
14851485 Map <String , String > details = new HashMap <>();
14861486 int currentValue = 123 ;
14871487
14881488 for (String detailsConstant : detailsConstants ) {
1489- userVmManagerImpl .updateInstanceDetailsKeepCurrentValueIfNull (null , details , detailsConstant , currentValue );
1489+ userVmManagerImpl .addCurrentDetailValueToInstanceDetailsMapIfNewValueWasNotSpecified (null , details , detailsConstant , currentValue );
14901490 }
14911491
14921492 Assert .assertEquals (details .get (VmDetailConstants .MEMORY ), String .valueOf (currentValue ));
@@ -1495,11 +1495,11 @@ public void updateInstanceDetailsKeepCurrentValueIfNullTestBothValuesAreNullKeep
14951495 }
14961496
14971497 @ Test
1498- public void updateInstanceDetailsKeepCurrentValueIfNullTestNeitherValueIsNullDoNothing () {
1498+ public void addCurrentDetailValueToInstanceDetailsMapIfNewValueWasNotSpecifiedTestNeitherValueIsNullDoNothing () {
14991499 int currentValue = 123 ;
15001500
15011501 for (String detailsConstant : detailsConstants ) {
1502- userVmManagerImpl .updateInstanceDetailsKeepCurrentValueIfNull (321 , customParameters , detailsConstant , currentValue );
1502+ userVmManagerImpl .addCurrentDetailValueToInstanceDetailsMapIfNewValueWasNotSpecified (321 , customParameters , detailsConstant , currentValue );
15031503 }
15041504
15051505 Assert .assertEquals (customParameters .get (VmDetailConstants .MEMORY ), "2048" );
@@ -1508,16 +1508,16 @@ public void updateInstanceDetailsKeepCurrentValueIfNullTestNeitherValueIsNullDoN
15081508 }
15091509
15101510 @ Test
1511- public void updateInstanceDetailsTestAllConstantsAreUpdated () {
1511+ public void updateInstanceDetailsMapWithCurrentValuesForAbsentDetailsTestAllConstantsAreUpdated () {
15121512 Mockito .doReturn (serviceOffering ).when (_serviceOfferingDao ).findById (Mockito .anyLong ());
15131513 Mockito .doReturn (1L ).when (vmInstanceMock ).getId ();
15141514 Mockito .doReturn (1L ).when (vmInstanceMock ).getServiceOfferingId ();
15151515 Mockito .doReturn (serviceOffering ).when (_serviceOfferingDao ).findByIdIncludingRemoved (Mockito .anyLong (), Mockito .anyLong ());
1516- userVmManagerImpl .updateInstanceDetails (null , vmInstanceMock , 0l );
1516+ userVmManagerImpl .updateInstanceDetailsMapWithCurrentValuesForAbsentDetails (null , vmInstanceMock , 0l );
15171517
1518- Mockito .verify (userVmManagerImpl ).updateInstanceDetailsKeepCurrentValueIfNull (Mockito .any (), Mockito .any (), Mockito .eq (VmDetailConstants .CPU_SPEED ), Mockito .any ());
1519- Mockito .verify (userVmManagerImpl ).updateInstanceDetailsKeepCurrentValueIfNull (Mockito .any (), Mockito .any (), Mockito .eq (VmDetailConstants .MEMORY ), Mockito .any ());
1520- Mockito .verify (userVmManagerImpl ).updateInstanceDetailsKeepCurrentValueIfNull (Mockito .any (), Mockito .any (), Mockito .eq (VmDetailConstants .CPU_NUMBER ), Mockito .any ());
1518+ Mockito .verify (userVmManagerImpl ).addCurrentDetailValueToInstanceDetailsMapIfNewValueWasNotSpecified (Mockito .any (), Mockito .any (), Mockito .eq (VmDetailConstants .CPU_SPEED ), Mockito .any ());
1519+ Mockito .verify (userVmManagerImpl ).addCurrentDetailValueToInstanceDetailsMapIfNewValueWasNotSpecified (Mockito .any (), Mockito .any (), Mockito .eq (VmDetailConstants .MEMORY ), Mockito .any ());
1520+ Mockito .verify (userVmManagerImpl ).addCurrentDetailValueToInstanceDetailsMapIfNewValueWasNotSpecified (Mockito .any (), Mockito .any (), Mockito .eq (VmDetailConstants .CPU_NUMBER ), Mockito .any ());
15211521 }
15221522
15231523 @ Test
0 commit comments