- Sort Score
- Result 10 results
- Languages All
Results 31 - 40 of 47 for thenThrow (0.07 sec)
-
src/test/java/jcifs/smb/SmbPipeInputStreamTest.java
when(tree.getConfig()).thenReturn(config); when(config.getTransactionBufferSize()).thenReturn(65535); when(tree.send(any(Smb2IoctlRequest.class), eq(RequestParam.NO_RETRY))).thenThrow(new SmbException("boom")); IOException ex = assertThrows(IOException.class, stream::available, "Should convert SmbException to IOException"); assertTrue(ex.getMessage().contains("boom")); }
Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 9.9K bytes - Viewed (0) -
src/test/java/jcifs/internal/fscc/FileSystemInformationTest.java
void 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: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 18.1K bytes - Viewed (0) -
src/test/java/jcifs/util/HMACT64Test.java
mockedCrypto.when(Crypto::getMD5).thenReturn(mockMd5); HMACT64 originalHmac = new HMACT64(TEST_KEY); when(mockMd5.clone()).thenThrow(new CloneNotSupportedException("Test Clone Not Supported")); assertThrows(IllegalStateException.class, originalHmac::clone); } }
Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 14.6K 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: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 13.2K bytes - Viewed (1) -
fess-crawler/src/test/java/org/codelibs/fess/crawler/processor/impl/SitemapsResponseProcessorTest.java
responseData.setResponseBody(content); when(crawlerContainer.getComponent("sitemapsHelper")).thenReturn(sitemapsHelper); when(sitemapsHelper.parse(any(InputStream.class))).thenThrow(new RuntimeException("Parse error")); // Execute and verify RuntimeException is thrown try { processor.process(responseData); fail("Should throw RuntimeException");
Registered: Sat Dec 20 11:21:39 UTC 2025 - Last Modified: Thu Nov 13 13:29:22 UTC 2025 - 12K bytes - Viewed (0) -
src/test/java/jcifs/pac/kerberos/KerberosTicketTest.java
try (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: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 11.4K bytes - Viewed (0) -
src/test/java/jcifs/config/DelegatingConfigurationTest.java
void testExceptionHandling() { // Given RuntimeException testException = new RuntimeException("Test exception"); when(mockDelegate.getResponseTimeout()).thenThrow(testException); // When & Then RuntimeException thrownException = assertThrows(RuntimeException.class, () -> { delegatingConfig.getResponseTimeout(); });
Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 20.7K bytes - Viewed (0) -
src/test/java/jcifs/smb/SmbFileInputStreamTest.java
void 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: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 07:14:38 UTC 2025 - 12.8K bytes - Viewed (0) -
src/test/java/jcifs/smb/SmbWatchHandleImplTest.java
when(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: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 11.5K bytes - Viewed (0) -
src/test/java/jcifs/internal/CommonServerMessageBlockTest.java
void 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: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 15.7K bytes - Viewed (0)