@@ -1454,11 +1454,11 @@ public void testRestoreVirtualMachineWithVMSnapshots() throws ResourceUnavailabl
1454
1454
}
1455
1455
1456
1456
@ Test
1457
- public void updateInstanceDetailsKeepCurrentValueIfNullTestDetailsConstantIsNotNullDoNothing () {
1457
+ public void addCurrentDetailValueToInstanceDetailsMapIfNewValueWasNotSpecifiedTestDetailsConstantIsNotNullDoNothing () {
1458
1458
int currentValue = 123 ;
1459
1459
1460
1460
for (String detailsConstant : detailsConstants ) {
1461
- userVmManagerImpl .updateInstanceDetailsKeepCurrentValueIfNull (null , customParameters , detailsConstant , currentValue );
1461
+ userVmManagerImpl .addCurrentDetailValueToInstanceDetailsMapIfNewValueWasNotSpecified (null , customParameters , detailsConstant , currentValue );
1462
1462
}
1463
1463
1464
1464
Assert .assertEquals (customParameters .get (VmDetailConstants .MEMORY ), "2048" );
@@ -1467,12 +1467,12 @@ public void updateInstanceDetailsKeepCurrentValueIfNullTestDetailsConstantIsNotN
1467
1467
}
1468
1468
1469
1469
@ Test
1470
- public void updateInstanceDetailsKeepCurrentValueIfNullTestNewValueIsNotNullDoNothing () {
1470
+ public void addCurrentDetailValueToInstanceDetailsMapIfNewValueWasNotSpecifiedTestNewValueIsNotNullDoNothing () {
1471
1471
Map <String , String > details = new HashMap <>();
1472
1472
int currentValue = 123 ;
1473
1473
1474
1474
for (String detailsConstant : detailsConstants ) {
1475
- userVmManagerImpl .updateInstanceDetailsKeepCurrentValueIfNull (321 , details , detailsConstant , currentValue );
1475
+ userVmManagerImpl .addCurrentDetailValueToInstanceDetailsMapIfNewValueWasNotSpecified (321 , details , detailsConstant , currentValue );
1476
1476
}
1477
1477
1478
1478
Assert .assertNull (details .get (VmDetailConstants .MEMORY ));
@@ -1481,12 +1481,12 @@ public void updateInstanceDetailsKeepCurrentValueIfNullTestNewValueIsNotNullDoNo
1481
1481
}
1482
1482
1483
1483
@ Test
1484
- public void updateInstanceDetailsKeepCurrentValueIfNullTestBothValuesAreNullKeepCurrentValue () {
1484
+ public void addCurrentDetailValueToInstanceDetailsMapIfNewValueWasNotSpecifiedTestBothValuesAreNullKeepCurrentValue () {
1485
1485
Map <String , String > details = new HashMap <>();
1486
1486
int currentValue = 123 ;
1487
1487
1488
1488
for (String detailsConstant : detailsConstants ) {
1489
- userVmManagerImpl .updateInstanceDetailsKeepCurrentValueIfNull (null , details , detailsConstant , currentValue );
1489
+ userVmManagerImpl .addCurrentDetailValueToInstanceDetailsMapIfNewValueWasNotSpecified (null , details , detailsConstant , currentValue );
1490
1490
}
1491
1491
1492
1492
Assert .assertEquals (details .get (VmDetailConstants .MEMORY ), String .valueOf (currentValue ));
@@ -1495,11 +1495,11 @@ public void updateInstanceDetailsKeepCurrentValueIfNullTestBothValuesAreNullKeep
1495
1495
}
1496
1496
1497
1497
@ Test
1498
- public void updateInstanceDetailsKeepCurrentValueIfNullTestNeitherValueIsNullDoNothing () {
1498
+ public void addCurrentDetailValueToInstanceDetailsMapIfNewValueWasNotSpecifiedTestNeitherValueIsNullDoNothing () {
1499
1499
int currentValue = 123 ;
1500
1500
1501
1501
for (String detailsConstant : detailsConstants ) {
1502
- userVmManagerImpl .updateInstanceDetailsKeepCurrentValueIfNull (321 , customParameters , detailsConstant , currentValue );
1502
+ userVmManagerImpl .addCurrentDetailValueToInstanceDetailsMapIfNewValueWasNotSpecified (321 , customParameters , detailsConstant , currentValue );
1503
1503
}
1504
1504
1505
1505
Assert .assertEquals (customParameters .get (VmDetailConstants .MEMORY ), "2048" );
@@ -1508,16 +1508,16 @@ public void updateInstanceDetailsKeepCurrentValueIfNullTestNeitherValueIsNullDoN
1508
1508
}
1509
1509
1510
1510
@ Test
1511
- public void updateInstanceDetailsTestAllConstantsAreUpdated () {
1511
+ public void updateInstanceDetailsMapWithCurrentValuesForAbsentDetailsTestAllConstantsAreUpdated () {
1512
1512
Mockito .doReturn (serviceOffering ).when (_serviceOfferingDao ).findById (Mockito .anyLong ());
1513
1513
Mockito .doReturn (1L ).when (vmInstanceMock ).getId ();
1514
1514
Mockito .doReturn (1L ).when (vmInstanceMock ).getServiceOfferingId ();
1515
1515
Mockito .doReturn (serviceOffering ).when (_serviceOfferingDao ).findByIdIncludingRemoved (Mockito .anyLong (), Mockito .anyLong ());
1516
- userVmManagerImpl .updateInstanceDetails (null , vmInstanceMock , 0l );
1516
+ userVmManagerImpl .updateInstanceDetailsMapWithCurrentValuesForAbsentDetails (null , vmInstanceMock , 0l );
1517
1517
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 ());
1521
1521
}
1522
1522
1523
1523
@ Test
0 commit comments