- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 27 for stubbing (0.03 sec)
-
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: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 7.9K bytes - Viewed (0) -
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: 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/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: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 6.4K 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: 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/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: Sun Sep 07 00:10:21 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: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 9.3K bytes - Viewed (0) -
src/test/java/jcifs/internal/witness/WitnessIntegrationTest.java
@BeforeEach void setUp() throws Exception { mockService = new MockWitnessService(); mockService.start(); // Setup mock configuration with lenient stubbing lenient().when(mockContext.getConfig()).thenReturn(mockConfig); lenient().when(mockConfig.isUseWitness()).thenReturn(true); lenient().when(mockConfig.getWitnessHeartbeatTimeout()).thenReturn(120000L);
Registered: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Sat Aug 23 09:06:40 UTC 2025 - 9.8K 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: Sun Sep 07 00:10:21 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 value
Registered: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Sat Aug 30 05:58:03 UTC 2025 - 9.9K bytes - Viewed (0) -
src/test/java/jcifs/smb/FileEntryTest.java
FileEntry e = null; // Act & Assert: demonstrate invalid usage results in NPE assertThrows(NullPointerException.class, () -> e.getName()); } @Nested @DisplayName("Mockito stubbing for edge cases") class MockitoEdgeCases { @Test @DisplayName("getName can return null and empty strings via mock") void mock_nameEdgeValues() { // Arrange
Registered: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 10K bytes - Viewed (0)