- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 22 for stubbing (2.07 sec)
-
src/test/java/jcifs/smb1/smb1/SmbConstantsTest.java
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: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 4.2K bytes - Viewed (0) -
src/test/java/jcifs/internal/SmbNegotiationRequestTest.java
// Then assertNotNull(mockRequest, "Mock should be created successfully"); } @Test @DisplayName("Test default behavior of mock without stubbing") void testDefaultBehaviorOfMock() { // Given SmbNegotiationRequest mockRequest = mock(SmbNegotiationRequest.class); // When boolean result = mockRequest.isSigningEnforced();Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 6.4K bytes - Viewed (0) -
src/test/java/jcifs/smb1/UniAddressTest.java
* with different kinds of inputs. Many static helpers in {@code * UniAddress} are network dependent and therefore not exercised here – they * would require complex stubbing of static methods. Instead the tests * concentrate on the instance methods and simple static predicates * that are observable without network access. */ @ExtendWith(MockitoExtension.class) class UniAddressTest {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/dcerpc/DcerpcPipeHandleTest.java
private static final String TEST_SERVER = "server"; private static final String TEST_ENDPOINT = "\\pipe\\test"; @BeforeEach void setUp() throws IOException { // Setup mock behavior with lenient stubbing to avoid UnnecessaryStubbingException lenient().when(mockSmbNamedPipe.openPipe()).thenReturn(mockSmbPipeHandle);
Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 21K bytes - Viewed (0) -
src/test/java/jcifs/internal/witness/WitnessClientTest.java
void setUp() throws Exception { witnessServer = InetAddress.getByName("192.168.1.200"); serverAddress = InetAddress.getByName("192.168.1.100"); // Setup mock configuration with lenient stubbing lenient().when(mockContext.getConfig()).thenReturn(mockConfig); lenient().when(mockConfig.getWitnessHeartbeatTimeout()).thenReturn(120000L);
Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Sat Aug 23 09:06:40 UTC 2025 - 9.8K bytes - Viewed (0) -
src/test/java/jcifs/smb1/smb1/SmbRandomAccessFileTest.java
import java.net.MalformedURLException; import java.net.UnknownHostException; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; class SmbRandomAccessFileTest { private SmbFile smbFile; private SmbTree smbTree; private SmbSession smbSession; private SmbTransport smbTransport;Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 9.3K bytes - Viewed (0) -
src/test/java/jcifs/smb/CredentialsInternalTest.java
// These methods do not throw and allow interaction checks. tc.getConfig(); 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() {Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 9.9K bytes - Viewed (0) -
src/test/java/jcifs/smb/JAASAuthenticatorTest.java
@Test @DisplayName("renew: invokes getSubject and returns self") void testRenewInvokesGetSubjectAndReturnsSelf() { JAASAuthenticator auth = spy(new JAASAuthenticator()); // Avoid real JAAS by stubbing getSubject doReturn(new Subject()).when(auth).getSubject(); // Act CredentialsInternal result = auth.renew(); // Assert interaction and return valueRegistered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Sat Aug 30 05:58:03 UTC 2025 - 9.9K bytes - Viewed (0) -
src/test/java/jcifs/netbios/NodeStatusResponseTest.java
@Mock private NbtAddress mockQueryAddress; private NodeStatusResponse response; @BeforeEach void setUp() throws Exception { // Setup mock configuration with lenient stubbing lenient().when(mockConfig.getOemEncoding()).thenReturn("UTF-8"); // Setup mock query address mockQueryAddress = mock(NbtAddress.class);Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 07:14:38 UTC 2025 - 19.3K bytes - Viewed (0) -
src/test/java/jcifs/smb/DirFileEntryEnumIterator1Test.java
} } } @BeforeEach void setup() throws MalformedURLException, CIFSException { // Common happy-path defaults // Use lenient() to avoid strict stubbing issues with Mockito lenient().when(tree.acquire()).thenReturn(tree); lenient().when(tree.getConfig()).thenReturn(config); lenient().when(config.getListCount()).thenReturn(10);Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 12.7K bytes - Viewed (0)