- Sort Score
- Result 10 results
- Languages All
Results 191 - 200 of 239 for thenReturn (0.06 sec)
-
src/test/java/jcifs/smb1/smb1/SmbConstantsTest.java
// Create a mock of SmbTransport from jcifs package jcifs.SmbTransport mock = mock(jcifs.SmbTransport.class); // Stub the getRemoteHostName method when(mock.getRemoteHostName()).thenReturn("test-host"); // Verify the stubbing assertEquals("test-host", mock.getRemoteHostName()); // Ensure that the mock was interacted with verify(mock).getRemoteHostName(); }Registered: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 4.2K bytes - Viewed (0) -
src/test/java/jcifs/dcerpc/ndr/NdrHyperTest.java
NdrHyper ndrHyper = new NdrHyper(0); // Initialize with a dummy value // Configure the mock NdrBuffer to return a specific value when dec_ndr_hyper is called when(mockNdrBuffer.dec_ndr_hyper()).thenReturn(decodedValue); // Call the decode method with the mocked NdrBuffer ndrHyper.decode(mockNdrBuffer); // Verify that dec_ndr_hyper was called exactly once
Registered: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 2.2K bytes - Viewed (0) -
src/test/java/jcifs/BufferCacheTest.java
@Test @DisplayName("getBuffer should return non-null byte array") void testGetBufferContract() { // Given byte[] expectedBuffer = new byte[1024]; when(mockBufferCache.getBuffer()).thenReturn(expectedBuffer); // When byte[] buffer = mockBufferCache.getBuffer(); // Then assertNotNull(buffer, "getBuffer should never return null");Registered: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 4.3K bytes - Viewed (0) -
android/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 Sep 05 12:43:10 UTC 2025 - Last Modified: Thu Dec 19 18:03:30 UTC 2024 - 5K bytes - Viewed (0) -
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 Sep 05 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: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 3K 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: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 18.1K 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: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 13.4K 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: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 3.2K bytes - Viewed (0) -
src/test/java/jcifs/smb/CredentialsInternalTest.java
tc.getCredentials(); // Minimal behavior: return a mock SSPContext with lenient stubbing SSPContext ctx = mock(SSPContext.class); lenient().when(ctx.isEstablished()).thenReturn(false); return ctx; } @Override public Subject getSubject() { return this.subject; } @Override
Registered: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 9.9K bytes - Viewed (0)