Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 17 for stubbing (0.23 sec)

  1. 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)
  2. 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)
  3. 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)
  4. 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)
  5. 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)
  6. 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)
  7. src/test/java/jcifs/ntlmssp/Type1MessageTest.java

        @Mock
        private NameServiceClient mockNameServiceClient;
    
        @Mock
        private NetbiosAddress mockLocalHost;
    
        @BeforeEach
        void setUp() {
            // Setup mock context with lenient stubbing to avoid UnnecessaryStubbingException
            lenient().when(mockContext.getConfig()).thenReturn(mockConfig);
            lenient().when(mockContext.getNameServiceClient()).thenReturn(mockNameServiceClient);
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 12.1K bytes
    - Viewed (0)
  8. 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: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 12.7K bytes
    - Viewed (0)
  9. 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: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 07:14:38 UTC 2025
    - 19.3K bytes
    - Viewed (0)
  10. src/test/java/jcifs/internal/smb2/notify/Smb2ChangeNotifyRequestTest.java

        void setUp() {
            mockConfig = mock(Configuration.class);
            mockContext = mock(CIFSContext.class);
            testFileId = new byte[16];
            Arrays.fill(testFileId, (byte) 0xAB);
    
            // Use lenient stubbing for default configuration values
            lenient().when(mockConfig.getNotifyBufferSize()).thenReturn(8192);
            lenient().when(mockContext.getConfig()).thenReturn(mockConfig);
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 17.1K bytes
    - Viewed (0)
Back to top