- Sort Score
- Result 10 results
- Languages All
Results 31 - 40 of 44 for thenThrow (0.05 sec)
- 
				
				src/test/java/jcifs/internal/fscc/FileSystemInformationTest.javavoid testDecodeException() throws SMBProtocolDecodingException { byte[] buffer = new byte[100]; when(mockFileSystemInfo.decode(any(byte[].class), anyInt(), anyInt())) .thenThrow(new SMBProtocolDecodingException("Test error")); assertThrows(SMBProtocolDecodingException.class, () -> { mockFileSystemInfo.decode(buffer, 0, 100); }); } } Registered: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 18.1K bytes - Viewed (0)
- 
				
				src/test/java/jcifs/pac/kerberos/KerberosTicketTest.javatry (MockedStatic<KerberosEncData> mockedEncData = Mockito.mockStatic(KerberosEncData.class)) { mockedEncData.when(() -> KerberosEncData.decrypt(ENCRYPTED_DATA, kerberosKey, ENCRYPTION_TYPE)) .thenThrow(new GeneralSecurityException("Decryption error")); PACDecodingException e = assertThrows(PACDecodingException.class, () -> new KerberosTicket(token, (byte) 0, keys)); Registered: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 11.4K bytes - Viewed (0)
- 
				
				src/test/java/jcifs/SmbWatchHandleTest.java@Test void testWatchThrowsCIFSException() throws CIFSException { // Setup mock behavior CIFSException expectedException = new CIFSException("Watch operation failed"); when(watchHandle.watch()).thenThrow(expectedException); // Execute and verify CIFSException thrown = assertThrows(CIFSException.class, () -> { watchHandle.watch(); });Registered: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 13.2K bytes - Viewed (0)
- 
				
				src/test/java/jcifs/dcerpc/DcerpcPipeHandleTest.javaDcerpcPipeHandle handle = createMockedDcerpcPipeHandle(); CIFSException exception = new CIFSException("Test exception"); when(mockSmbPipeHandleInternal.getSessionKey()).thenThrow(exception); assertThrows(CIFSException.class, handle::getSessionKey); } } @Nested @DisplayName("Send/Receive Fragment Tests") class SendReceiveFragmentTests { Registered: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 21K bytes - Viewed (0)
- 
				
				src/test/java/jcifs/internal/CommonServerMessageBlockTest.javavoid testDecodeThrowsException() throws SMBProtocolDecodingException { // Given byte[] buffer = new byte[10]; int bufferIndex = 0; when(messageBlock.decode(buffer, bufferIndex)).thenThrow(new SMBProtocolDecodingException("Invalid buffer")); // When & Then assertThrows(SMBProtocolDecodingException.class, () -> messageBlock.decode(buffer, bufferIndex)); } @Test Registered: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 15.7K bytes - Viewed (0)
- 
				
				src/test/java/jcifs/smb/SmbWatchHandleImplTest.javawhen(handle.getFileId()).thenReturn(new byte[16]); when(tree.send(any(CommonServerMessageBlockRequest.class), any(), any(), any())) .thenThrow(new SmbException(0xC0000120, (Throwable) null)); SmbWatchHandleImpl sut = new SmbWatchHandleImpl(handle, 0, false); List<FileNotifyInformation> result = sut.watch(); Registered: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 11.5K bytes - Viewed (0)
- 
				
				src/test/java/jcifs/smb/SmbFileInputStreamTest.javavoid readSingleByteEOF() throws Exception { // Arrange SMB2 EOF via NT status code mapping in SmbFileInputStream when(mockTree.send(any(Request.class), any(RequestParam.class))).thenThrow(new SmbException(0xC0000011, false)); // STATUS_END_OF_FILE SmbFileInputStream in = newStream(); int v = in.read(); assertEquals(-1, v); } } @Nested Registered: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 07:14:38 UTC 2025 - 12.8K bytes - Viewed (0)
- 
				
				src/test/java/jcifs/config/DelegatingConfigurationTest.javavoid testExceptionHandling() { // Given RuntimeException testException = new RuntimeException("Test exception"); when(mockDelegate.getResponseTimeout()).thenThrow(testException); // When & Then RuntimeException thrownException = assertThrows(RuntimeException.class, () -> { delegatingConfig.getResponseTimeout(); }); Registered: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 20.7K bytes - Viewed (0)
- 
				
				src/test/java/jcifs/smb/DirFileEntryEnumIteratorBaseTest.javavoid nameFilterThrowsIsHandled() throws Exception { // Arrange stubAcquireReturnsSelf(); when(nameFilter.accept(parent, "bad")).thenThrow(new CIFSException("bad name")); when(nameFilter.accept(parent, "good")).thenReturn(true); FileEntry initial = entry("first"); FileEntry[] page1 = new FileEntry[] { entry("bad"), entry("good") }; Registered: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 14.5K bytes - Viewed (0)
- 
				
				src/test/java/jcifs/internal/smb2/create/CreateContextResponseTest.javaCreateContextResponse response = mock(CreateContextResponse.class); byte[] buffer = new byte[100]; when(response.decode(any(byte[].class), anyInt(), anyInt())).thenThrow(new SMBProtocolDecodingException("Test error")); assertThrows(SMBProtocolDecodingException.class, () -> response.decode(buffer, 0, 10)); } } @Nested Registered: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 16.2K bytes - Viewed (0)