|
30 | 30 | import org.apache.cloudstack.storage.feign.model.Lun; |
31 | 31 | import org.apache.cloudstack.storage.feign.model.LunMap; |
32 | 32 | import org.apache.cloudstack.storage.feign.model.OntapStorage; |
33 | | -import org.apache.cloudstack.storage.feign.model.Svm; |
34 | 33 | import org.apache.cloudstack.storage.feign.model.response.OntapResponse; |
35 | 34 | import org.apache.cloudstack.storage.service.model.AccessGroup; |
36 | 35 | import org.apache.cloudstack.storage.service.model.CloudStackVolume; |
@@ -788,41 +787,29 @@ void testValidateInitiatorInAccessGroup_IgroupNotFound_ReturnsFalse() { |
788 | 787 | } |
789 | 788 |
|
790 | 789 | @Test |
791 | | - void testCopyCloudStackVolume_NullRequest_ThrowsException() { |
792 | | - assertThrows(CloudRuntimeException.class, |
793 | | - () -> unifiedSANStrategy.copyCloudStackVolume(null)); |
| 790 | + void testCopyCloudStackVolume_NullRequest_DoesNotThrow() { |
| 791 | + // copyCloudStackVolume is not yet implemented (no-op), so it should not throw |
| 792 | + assertDoesNotThrow(() -> unifiedSANStrategy.copyCloudStackVolume(null)); |
794 | 793 | } |
795 | 794 |
|
796 | 795 | @Test |
797 | | - void testCopyCloudStackVolume_NullLun_ThrowsException() { |
| 796 | + void testCopyCloudStackVolume_NullLun_DoesNotThrow() { |
| 797 | + // copyCloudStackVolume is not yet implemented (no-op), so it should not throw |
798 | 798 | CloudStackVolume request = new CloudStackVolume(); |
799 | 799 | request.setLun(null); |
800 | 800 |
|
801 | | - assertThrows(CloudRuntimeException.class, |
802 | | - () -> unifiedSANStrategy.copyCloudStackVolume(request)); |
| 801 | + assertDoesNotThrow(() -> unifiedSANStrategy.copyCloudStackVolume(request)); |
803 | 802 | } |
804 | 803 |
|
805 | 804 | @Test |
806 | | - void testCopyCloudStackVolume_FeignException_ThrowsCloudRuntimeException() { |
| 805 | + void testCopyCloudStackVolume_ValidRequest_DoesNotThrow() { |
| 806 | + // copyCloudStackVolume is not yet implemented (no-op), so it should not throw |
807 | 807 | Lun lun = new Lun(); |
808 | 808 | lun.setName("/vol/vol1/lun1"); |
809 | 809 | CloudStackVolume request = new CloudStackVolume(); |
810 | 810 | request.setLun(lun); |
811 | 811 |
|
812 | | - FeignException feignException = mock(FeignException.class); |
813 | | - when(feignException.status()).thenReturn(500); |
814 | | - when(feignException.getMessage()).thenReturn("Internal server error"); |
815 | | - |
816 | | - try (MockedStatic<Utility> utilityMock = mockStatic(Utility.class)) { |
817 | | - utilityMock.when(() -> Utility.generateAuthHeader("admin", "password")) |
818 | | - .thenReturn(authHeader); |
819 | | - |
820 | | - when(sanFeignClient.createLun(eq(authHeader), eq(true), any(Lun.class))) |
821 | | - .thenThrow(feignException); |
822 | | - |
823 | | - assertThrows(CloudRuntimeException.class, |
824 | | - () -> unifiedSANStrategy.copyCloudStackVolume(request)); |
825 | | - } |
| 812 | + assertDoesNotThrow(() -> unifiedSANStrategy.copyCloudStackVolume(request)); |
826 | 813 | } |
827 | 814 |
|
828 | 815 | @Test |
|
0 commit comments