- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 14 for thenAnswer (0.67 sec)
-
src/test/java/jcifs/smb/NetServerEnumIteratorTest.java
when(locator.getURL()).thenReturn(createSmbURL("smb://")); // Mock successful but empty response when(treeHandle.send(any(), any(), (RequestParam[]) any())).thenAnswer(invocation -> { // The response is the second argument Object response = invocation.getArgument(1); // Return it unchanged (which will have default values = empty results)
Registered: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 9.8K bytes - Viewed (0) -
src/test/java/jcifs/smb/DirFileEntryEnumIterator1Test.java
batches.add(new String[] {}); // last -> NO_MORE_FILES // send() answer that mutates the provided response when(tree.send(any(Trans2FindFirst2.class), any(Trans2FindFirst2Response.class))).thenAnswer((InvocationOnMock inv) -> { Trans2FindFirst2Response resp = inv.getArgument(1); // First response content FE[] res = java.util.Arrays.stream(batches.get(0)).map(FE::new).toArray(FE[]::new);
Registered: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 12.7K bytes - Viewed (0) -
src/test/java/jcifs/http/NtlmHttpFilterTest.java
initParams.put("jcifs.http.basicRealm", "TestRealm"); when(filterConfig.getInitParameterNames()).thenReturn(Collections.enumeration(initParams.keySet())); when(filterConfig.getInitParameter(anyString())).thenAnswer(invocation -> initParams.get(invocation.getArgument(0))); assertDoesNotThrow(() -> filter.init(filterConfig)); } @Test void testInit_withMinimalConfig() throws ServletException {
Registered: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 21 04:51:33 UTC 2025 - 12.8K bytes - Viewed (0) -
src/test/java/jcifs/dcerpc/DcerpcPipeHandleTest.java
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/netbios/LmhostsTest.java
when(mock.read()).thenAnswer(inv -> { if (index[0] < includeContent.length) { return (int) includeContent[index[0]++] & 0xFF; } return -1; }); when(mock.read(any(byte[].class))).thenAnswer(inv -> { byte[] buffer = inv.getArgument(0);
Registered: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 18.2K bytes - Viewed (0) -
src/test/java/jcifs/http/NtlmServletTest.java
lenient().when(servletConfig.getInitParameterNames()).thenReturn(Collections.enumeration(initParams.keySet())); lenient().when(servletConfig.getInitParameter(anyString())).thenAnswer(invocation -> initParams.get(invocation.getArgument(0))); // Mock HTTP method for request - this is required for HttpServlet.service() lenient().when(request.getMethod()).thenReturn("GET");
Registered: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 21 04:51:33 UTC 2025 - 11.5K bytes - Viewed (0) -
src/test/java/jcifs/smb/SmbFileInputStreamTest.java
Smb2ReadResponse smb2Resp = mock(Smb2ReadResponse.class); when(smb2Resp.getDataLength()).thenReturn(3); when(mockTree.send(any(Request.class), any(RequestParam.class))).thenAnswer(inv -> (CommonServerMessageBlockResponse) smb2Resp); byte[] buf = new byte[16]; // Skip advances internal file pointer; next read should use this offset in.skip(2);
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/smb/SmbTransportInternalTest.java
@DisplayName("hasCapability returns expected values for various caps") @ValueSource(ints = { -1, 0, 1, 1024 }) void hasCapability_variousCaps(int cap) throws SmbException { when(transport.hasCapability(anyInt())).thenAnswer(inv -> ((int) inv.getArgument(0)) >= 0); boolean result = transport.hasCapability(cap); assertEquals(cap >= 0, result); verify(transport, times(1)).hasCapability(cap); }
Registered: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 07:14:38 UTC 2025 - 12.1K bytes - Viewed (0) -
src/test/java/jcifs/smb/SmbPipeHandleInternalTest.java
// Mock both sends and return response when(tree.send(any(TransWaitNamedPipe.class), any(TransWaitNamedPipeResponse.class))).thenAnswer(inv -> inv.getArgument(1)); when(tree.send(any(TransCallNamedPipe.class), any(TransCallNamedPipeResponse.class))).thenAnswer(inv -> inv.getArgument(1)); int n = handle.sendrecv(new byte[3], 0, 3, new byte[8], 64);
Registered: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 07:14:38 UTC 2025 - 16.7K bytes - Viewed (0) -
src/test/java/jcifs/internal/smb2/rdma/RdmaBufferManagerTest.java
public void setUp() throws Exception { mocks = MockitoAnnotations.openMocks(this); // Set up mock provider to return TCP memory regions when(mockProvider.registerMemory(any(ByteBuffer.class), any())).thenAnswer(invocation -> { ByteBuffer buffer = invocation.getArgument(0); EnumSet<RdmaAccess> access = invocation.getArgument(1); return new TcpMemoryRegion(buffer, access); });
Registered: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Sat Aug 23 05:11:12 UTC 2025 - 7.1K bytes - Viewed (0)