- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 376 for WHEN (2.35 sec)
-
src/test/java/jcifs/SmbFileHandleTest.java
when(smbFileHandle.isValid()).thenReturn(true); assertTrue(smbFileHandle.isValid(), "isValid should return true when the handle is valid."); verify(smbFileHandle, times(1)).isValid(); } /** * Test isValid() when the handle is invalid. */ @Test void testIsValid_whenInvalid() { when(smbFileHandle.isValid()).thenReturn(false);
Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 5.1K bytes - Viewed (0) -
src/test/java/jcifs/smb/DfsImplTest.java
// Set up mock behaviors when(mockContext.getConfig()).thenReturn(mockConfig); when(mockContext.getCredentials()).thenReturn(mockCredentials); when(mockContext.getTransportPool()).thenReturn(mockTransportPool); when(mockConfig.getDfsTtl()).thenReturn(300L); // Mock transport to throw IOException - simulating connection failureRegistered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 5.5K bytes - Viewed (0) -
src/test/java/jcifs/smb1/smb1/FileEntryTest.java
void mockReturnsConfiguredValues() { FileEntry mock = mock(FileEntry.class); when(mock.getName()).thenReturn("test.txt"); when(mock.getType()).thenReturn(1); when(mock.getAttributes()).thenReturn(128); when(mock.createTime()).thenReturn(1_500L); when(mock.lastModified()).thenReturn(1_800L); when(mock.length()).thenReturn(100L); assertEquals("test.txt", mock.getName());
Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 3K bytes - Viewed (0) -
src/test/java/jcifs/smb/SmbPipeOutputStreamTest.java
private SmbPipeOutputStream newStream() throws CIFSException { // Arrange common constructor collaborators to avoid touching network/state when(handle.getPipe()).thenReturn(pipe); when(tree.isSMB2()).thenReturn(true); when(tree.getSendBufferSize()).thenReturn(4096); // Act return new SmbPipeOutputStream(handle, tree); } @ParameterizedTestRegistered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 5.4K bytes - Viewed (0) -
src/test/java/jcifs/smb/SmbSessionInternalTest.java
} // Error propagation: connect to logon share throws SmbException @Test @DisplayName("treeConnectLogon throws SmbException when underlying call fails") void treeConnectLogon_throws() throws SmbException { doThrow(new SmbException("logon failed")).when(session).treeConnectLogon(); SmbException ex = assertThrows(SmbException.class, () -> session.treeConnectLogon());Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 6.8K bytes - Viewed (0) -
src/test/java/jcifs/NetbiosNameTest.java
// Given when(mockNetbiosName.getNameType()).thenReturn(nameType); // When int result = mockNetbiosName.getNameType(); // Then assertEquals(nameType, result); } @Test @DisplayName("Should handle null name") void testNullName() { // Given when(mockNetbiosName.getName()).thenReturn(null); // WhenRegistered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 8K bytes - Viewed (0) -
src/test/java/jcifs/DfsResolverTest.java
when(mockConfig.isDfsDisabled()).thenReturn(false); when(mockContext.getTransportPool()).thenReturn(mockTransportPool); when(mockTransportPool.getSmbTransport(any(), anyString(), anyInt(), anyBoolean(), anyBoolean())).thenReturn(mockTransport); when(mockTransport.unwrap(any())).thenReturn(mockTransport);
Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 4.5K bytes - Viewed (0) -
src/test/java/jcifs/smb/SmbTreeImplTest.java
MockitoAnnotations.openMocks(this); when(session.getConfig()).thenReturn(config); when(session.getContext()).thenReturn(context); when(session.getTransport()).thenReturn(transport); when(session.acquire()).thenReturn(session); when(config.isTraceResourceUsage()).thenReturn(false); when(context.getConfig()).thenReturn(config); when(session.isConnected()).thenReturn(true); }
Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 7.8K bytes - Viewed (0) -
src/test/java/jcifs/CIFSContextTest.java
// When mockContext.close(); // Then verify(mockContext).close(); } @Test @DisplayName("Should get Configuration") void testGetConfig() { // Given Configuration mockConfig = mock(Configuration.class); when(mockContext.getConfig()).thenReturn(mockConfig); // WhenRegistered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 8.8K bytes - Viewed (0) -
src/test/java/jcifs/DfsReferralDataTest.java
// When int result = mockReferralData.getPathConsumed(); // Then assertEquals(pathConsumed, result); verify(mockReferralData).getPathConsumed(); } @Test @DisplayName("Should get path") void testGetPath() { // Given String path = "/test/path";Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 4.1K bytes - Viewed (0)