bhouse-nexthop commented on code in PR #14750:
URL: https://github.com/apache/cloudstack/pull/14750#discussion_r4757026057
##########
server/src/test/java/com/cloud/storage/VolumeApiServiceImplTest.java:
##########
@@ -2504,4 +2504,82 @@ public void
testResizeVolumeInternal_VMware_VMRunning_ShouldThrowStateGuardError
e.getMessage() != null && e.getMessage().contains("VM
should be in"));
}
}
+
+ private void setupSameCustomDiskOfferingChange(long volumeSizeInBytes) {
+ when(volumeVoMock.getSize()).thenReturn(volumeSizeInBytes);
+ when(diskOfferingMock.getId()).thenReturn(diskOfferingMockId);
+ when(diskOfferingMock.getRemoved()).thenReturn(null);
+ when(diskOfferingMock.getDiskSize()).thenReturn(0L);
+ when(diskOfferingMock.isComputeOnly()).thenReturn(false);
+ when(diskOfferingMock.isCustomized()).thenReturn(true);
+ when(diskOfferingMock.getDiskSizeStrictness()).thenReturn(false);
+ Mockito.lenient().when(diskOfferingMock.getTagsArray()).thenReturn(new
String[0]);
+
Mockito.lenient().when(volumeVoMock.getVolumeType()).thenReturn(Type.DATADISK);
+ }
+
+ @Test
Review Comment:
Added `validateVolumeResizeWithNewDiskOfferingRejectsSameNonCustomOffering`
in 2f150bf89f: the same non-custom offering, with its fixed size, is still
refused with "is already having disk offering".
I'd leave the other branches of
`validateVolumeResizeWithNewDiskOfferingAndLoad` (removed offering, size
strictness, missing or invalid size) out of this PR. This change doesn't touch
them, and I'd rather keep the PR to the byte comparison and the IOPS check.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]