- Sort Score
- Result 10 results
- Languages All
Results 221 - 230 of 270 for thenReturn (0.05 sec)
-
guava-tests/test/com/google/common/hash/HashingInputStreamTest.java
super.setUp(); hasher = mock(Hasher.class); hashFunction = mock(HashFunction.class); buffer = new ByteArrayInputStream(testBytes); when(hashFunction.newHasher()).thenReturn(hasher); } public void testRead_putSingleByte() throws Exception { HashingInputStream in = new HashingInputStream(hashFunction, buffer); int b = in.read(); assertEquals('y', b);
Registered: Fri Dec 26 12:43:10 UTC 2025 - Last Modified: Thu Dec 19 18:03:30 UTC 2024 - 5K bytes - Viewed (0) -
src/test/java/jcifs/netbios/SessionRetargetResponsePacketTest.java
// Test that an IOException is thrown if the input stream does not provide enough bytes. // Simulate reading less than 6 bytes. when(mockInputStream.read(any(byte[].class), anyInt(), anyInt())).thenReturn(5); // Simulate reading only 5 bytes SessionRetargetResponsePacket packet = new SessionRetargetResponsePacket(); byte[] buffer = new byte[6];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/internal/smb2/rdma/RdmaIntegrationTest.java
// Create a mock SmbTransportInternal for RdmaTransport SmbTransportInternal mockTransport = mock(SmbTransportInternal.class); when(mockTransport.isDisconnected()).thenReturn(true); when(mockTransport.toString()).thenReturn("MockTransport"); try (RdmaTransport transport = new RdmaTransport(mockTransport, testContext)) { assertNotNull(transport, "Transport should not be null");Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Sat Aug 23 05:11:12 UTC 2025 - 13.8K bytes - Viewed (0) -
src/test/java/jcifs/internal/fscc/FileSystemInformationTest.java
@Test @DisplayName("Should return configured file system information class") void testGetFileSystemInformationClass() { when(mockFileSystemInfo.getFileSystemInformationClass()).thenReturn(FileSystemInformation.FS_SIZE_INFO); byte result = mockFileSystemInfo.getFileSystemInformationClass(); assertEquals(FileSystemInformation.FS_SIZE_INFO, result);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/dcerpc/ndr/NdrLongTest.java
int decodedValue = 54321; // Configure the mock to return a specific value when dec_ndr_long is called when(mockNdrBuffer.dec_ndr_long()).thenReturn(decodedValue); NdrLong ndrLong = new NdrLong(0); // Initialize with a dummy value // Call the decode method ndrLong.decode(mockNdrBuffer);Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 3.2K bytes - Viewed (0) -
src/test/java/jcifs/internal/smb1/trans/SmbComTransactionResponseTest.java
} } @BeforeEach void setUp() { MockitoAnnotations.openMocks(this); when(mockConfig.getMaximumBufferSize()).thenReturn(65535); when(mockConfig.getPid()).thenReturn(1234); response = new TestSmbComTransactionResponse(mockConfig); } @Test @DisplayName("Test constructor initialization with config only")Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 13.4K bytes - Viewed (0) -
src/test/java/jcifs/smb/SmbFilenameFilterTest.java
@DisplayName("filter can use SmbFile directory for decision logic") void filterCanUseSmbFileForDecision() throws Exception { // Stub the getPath method to return a specific value when(mockDir.getPath()).thenReturn("/share/folder/"); // Implementation uses dir.getPath() to check if file should be in that path SmbFilenameFilter filter = (dir, name) -> { if (dir == null) return false;Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 7.3K bytes - Viewed (0) -
src/test/java/jcifs/pac/PacTest.java
// Mock the calculateMac method to return a valid checksum byte[] mockChecksum = new byte[16]; pacMacMock.when(() -> PacMac.calculateMac(anyInt(), any(), any())).thenReturn(mockChecksum); // Create a minimal valid PAC structure ByteArrayOutputStream baos = new ByteArrayOutputStream(); writeLittleEndianInt(baos, 3); // bufferCount = 3 (minimum required)Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 7.9K bytes - Viewed (0) -
src/test/java/jcifs/smb/SIDTest.java
@Mock CIFSContext mockCtx; @Mock SidResolver mockResolver; @BeforeEach void setup() { lenient().when(mockCtx.getSIDResolver()).thenReturn(mockResolver); } @Test @DisplayName("Manual resolve calls resolver with this SID") void testResolveManual() throws Exception { // ArrangeRegistered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 15.8K bytes - Viewed (0) -
src/test/java/jcifs/internal/smb1/com/SmbComNTCreateAndXTest.java
} @Test @DisplayName("initResponse prepares a response instance") void initResponseCreatesResponse() { SmbComNTCreateAndX req = createRequest(0, 0); when(mockContext.getConfig()).thenReturn(mockConfig); SmbComNTCreateAndXResponse resp = req.initResponse(mockContext); assertNotNull(resp, "Response should not be null after init"); // getResponse should now return the same instanceRegistered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 5.6K bytes - Viewed (0)