|
54 | 54 | import javax.naming.ConfigurationException; |
55 | 55 | import java.io.File; |
56 | 56 | import java.io.IOException; |
| 57 | +import java.lang.reflect.InvocationTargetException; |
57 | 58 | import java.lang.reflect.Method; |
58 | 59 | import java.nio.file.Files; |
59 | 60 | import java.nio.file.Path; |
@@ -923,29 +924,6 @@ public void testCleanupBrokenBitmap_QemuImgException() { |
923 | 924 | } |
924 | 925 | } |
925 | 926 |
|
926 | | - @Test |
927 | | - public void testCleanupBrokenBitmap_NullVolumePath() { |
928 | | - String bitmapName = "checkpoint-789"; |
929 | | - |
930 | | - try { |
931 | | - Mockito.when(kvmStoragePoolMock.getLocalPathFor(Mockito.anyString())) |
932 | | - .thenReturn(null); |
933 | | - Mockito.when(volumeObjectToMock.getPath()).thenReturn("volume-path"); |
934 | | - |
935 | | - java.lang.reflect.Method method = KVMStorageProcessor.class.getDeclaredMethod( |
936 | | - "cleanupBrokenBitmap", KVMStoragePool.class, VolumeObjectTO.class, String.class); |
937 | | - method.setAccessible(true); |
938 | | - method.invoke(storageProcessorSpy, kvmStoragePoolMock, volumeObjectToMock, bitmapName); |
939 | | - |
940 | | - Assert.assertTrue("Method should handle null volume path gracefully", true); |
941 | | - } catch (java.lang.reflect.InvocationTargetException e) { |
942 | | - Assert.fail("Method should handle null volume path internally, but threw: " + |
943 | | - (e.getCause() != null ? e.getCause().getMessage() : e.getMessage())); |
944 | | - } catch (Exception e) { |
945 | | - Assert.fail("Failed to test cleanupBrokenBitmap: " + e.getMessage()); |
946 | | - } |
947 | | - } |
948 | | - |
949 | 927 | @Test |
950 | 928 | public void testIsBitmapUsable_MultipleFlagsWithInUse() { |
951 | 929 | String jsonOutput = "{\n" + |
|
0 commit comments