- Sort Score
- Result 10 results
- Languages All
Results 221 - 230 of 239 for thenReturn (0.05 sec)
-
src/test/java/jcifs/internal/smb1/trans2/Trans2GetDfsReferralTest.java
// Mock the request buffer DfsReferralRequestBuffer mockRequest = mock(DfsReferralRequestBuffer.class); when(mockRequest.encode(any(byte[].class), anyInt())).thenReturn(10); // Inject mock request Field requestField = Trans2GetDfsReferral.class.getDeclaredField("request"); requestField.setAccessible(true);Registered: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 11K bytes - Viewed (0) -
src/test/java/jcifs/internal/smb1/com/SmbComSeekResponseTest.java
@Mock private Configuration mockConfig; private SmbComSeekResponse response; @BeforeEach void setUp() { // Setup mock configuration to avoid NPE when(mockConfig.getPid()).thenReturn(12345); response = new SmbComSeekResponse(mockConfig); } /* ------------------------------------------------------------------ */Registered: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 8.1K bytes - Viewed (0) -
src/test/java/jcifs/smb/SmbTreeConnectionTraceTest.java
void getConfig_delegatesToContext() { // Arrange CIFSContext ctx = mock(CIFSContext.class); Configuration cfg = mock(Configuration.class); when(ctx.getConfig()).thenReturn(cfg); SmbTreeConnectionTrace trace = new SmbTreeConnectionTrace(ctx); // Act Configuration result = trace.getConfig(); // Assert assertSame(cfg, result);
Registered: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 8.7K bytes - Viewed (0) -
src/test/java/jcifs/http/HandlerTest.java
}; URL url = new URL("http://custom.protocol/path"); // Configure the mock factory to return our handler for the 'http' protocol. when(mockFactory.createURLStreamHandler("http")).thenReturn(mockStreamHandler); Handler.setURLStreamHandlerFactory(mockFactory); URLConnection connection = handler.openConnection(url);Registered: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 11.1K bytes - Viewed (0) -
src/test/java/jcifs/internal/smb2/io/Smb2FlushRequestTest.java
private Smb2FlushRequest request; @BeforeEach void setUp() { mockConfig = mock(Configuration.class); mockContext = mock(CIFSContext.class); when(mockContext.getConfig()).thenReturn(mockConfig); // Create a test file ID (16 bytes) testFileId = new byte[16]; for (int i = 0; i < 16; i++) { testFileId[i] = (byte) (i + 1); }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/internal/smb1/trans2/Trans2FindNext2Test.java
assertEquals(0, read); } @Test void testToString() { // Test toString method when(mockConfig.getListSize()).thenReturn(50); trans2FindNext2 = new Trans2FindNext2(mockConfig, TEST_SID, TEST_RESUME_KEY, TEST_FILENAME, TEST_BATCH_COUNT, TEST_BATCH_SIZE); String result = trans2FindNext2.toString();Registered: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 12.2K bytes - Viewed (0) -
src/test/java/jcifs/smb1/smb1/SmbTreeTest.java
// Setup session.transport field (accessed directly in SmbTree) session.transport = transport; // Setup session to return transport via method call when(session.transport()).thenReturn(transport); } @Test void testConstructor() { // Test constructor with a specific service SmbTree tree = new SmbTree(session, "testShare", "testService");
Registered: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 07:14:38 UTC 2025 - 10.2K bytes - Viewed (0) -
src/test/java/jcifs/internal/smb2/nego/NegotiateContextRequestTest.java
void testMockImplementation() { NegotiateContextRequest mockRequest = mock(NegotiateContextRequest.class); when(mockRequest.getContextType()).thenReturn(0xFF); assertEquals(0xFF, mockRequest.getContextType()); verify(mockRequest).getContextType(); } } @Nested @DisplayName("Edge Cases and Error Conditions")
Registered: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 18.8K bytes - Viewed (0) -
src/test/java/jcifs/internal/smb1/trans/nt/NtTransQuerySecurityDescTest.java
private static final int ALL_SECURITY_INFORMATION = 0x0000000F; @BeforeEach void setUp() { MockitoAnnotations.openMocks(this); when(mockConfig.getTransactionBufferSize()).thenReturn(65535); } @Test @DisplayName("Test constructor initialization with basic parameters") void testConstructorBasic() { int fid = 0x1234; int securityInfo = OWNER_SECURITY_INFORMATION;Registered: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 13.9K bytes - Viewed (0) -
src/test/java/jcifs/internal/smb1/net/NetServerEnum2Test.java
// Use real configuration for most tests realConfig = new BaseConfiguration(false); // Mock configuration setup when(mockConfig.getTransactionBufferSize()).thenReturn(65535); } @Test @DisplayName("Test constructor with domain and server types") void testConstructor() { String domain = "WORKGROUP"; int serverTypes = NetServerEnum2.SV_TYPE_ALL;Registered: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 19.7K bytes - Viewed (0)