Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 394 for mocked (0.06 sec)

  1. src/test/java/jcifs/smb/RequestParamTest.java

        interface EnumConsumer {
            void accept(RequestParam rp);
        }
    
        @Mock
        EnumConsumer consumer;
    
        @Test
        @DisplayName("Enum value can be passed to collaborators without side effects")
        void enumUsedWithCollaboratorHasNoSideEffects() {
            // Arrange: pick a value and a mocked consumer
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 5.2K bytes
    - Viewed (0)
  2. src/test/java/jcifs/smb/SessionSetupHandlerTest.java

        }
    
        @Mock
        SessionSetupHandler mocked;
    
        @Test
        @DisplayName("Interactions: Mockito mock has no interactions by default")
        void testMockitoNoInteractions() {
            // Intent: ensure we can mock the interface and verify no unexpected calls
            // Act & Assert
            assertNotNull(mocked);
            verifyNoInteractions(mocked);
        }
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 4.3K bytes
    - Viewed (0)
  3. src/test/java/jcifs/dcerpc/msrpc/MsrpcSamrCloseHandleTest.java

        void constructorShouldInitializeCorrectly() {
            // Given
            // mockPolicyHandle is already mocked by @Mock and initialized by @BeforeEach
    
            // When
            MsrpcSamrCloseHandle msrpcSamrCloseHandle = new MsrpcSamrCloseHandle(mockPolicyHandle);
    
            // Then
            assertNotNull(msrpcSamrCloseHandle, "MsrpcSamrCloseHandle object should not be null");
            assertEquals(0, msrpcSamrCloseHandle.getPtype(), "ptype should be 0");
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 1.4K bytes
    - Viewed (0)
  4. src/test/java/jcifs/smb1/smb1/DosErrorTest.java

        }
    
        @Test
        @DisplayName("Mocked consumer receives correct NTSTATUS value")
        void testConsumerInteraction() {
            final int dosErr = 0x00010001;
            final int expectedNt = 0xc0000002;
    
            interface NtStatusConsumer {
                void consume(int ntStatus);
            }
            NtStatusConsumer mock = mock(NtStatusConsumer.class);
            findNtStatus(dosErr).ifPresent(mock::consume);
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 3K bytes
    - Viewed (0)
  5. src/test/java/jcifs/pac/kerberos/KerberosTicketTest.java

    import org.junit.jupiter.api.extension.ExtendWith;
    import org.mockito.Mock;
    import org.mockito.MockedStatic;
    import org.mockito.Mockito;
    import org.mockito.junit.jupiter.MockitoExtension;
    
    import jcifs.pac.PACDecodingException;
    
    /**
     * Unit tests for the KerberosTicket class.
     */
    @ExtendWith(MockitoExtension.class)
    class KerberosTicketTest {
    
        @Mock
        private KerberosKey kerberosKey;
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 11.4K bytes
    - Viewed (0)
  6. src/test/java/jcifs/smb1/dcerpc/ndr/NdrHyperTest.java

     * The tests verify that:
     * <ul>
     *   <li>encoding and decoding round‑trip correctly handle typical, zero,
     *       and extreme {@code long} values.</li>
     *   <li>encode/decode methods interact correctly with a mocked
     *       {@link NdrBuffer} so that the correct method is called with
     *       the correct argument.</li>
     *   <li>passing {@code null} throws {@link NullPointerException}.
     * </ul>
     *
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 4.3K bytes
    - Viewed (0)
  7. src/test/java/jcifs/smb/SmbNamedPipeTest.java

            // Arrange: real instance to call protected method; collaborators mocked for interaction verification
            SmbNamedPipe pipe = new SmbNamedPipe("smb://server/IPC$/foo", SmbPipeResource.PIPE_TYPE_RDWR, ctx());
            SmbComNTCreateAndX req = mock(SmbComNTCreateAndX.class);
            SmbComNTCreateAndXResponse resp = mock(SmbComNTCreateAndXResponse.class);
    
            // Act
            pipe.customizeCreate(req, resp);
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 5.2K bytes
    - Viewed (0)
  8. src/test/java/jcifs/SmbFileHandleTest.java

    import org.junit.jupiter.api.extension.ExtendWith;
    import org.mockito.Mock;
    import org.mockito.junit.jupiter.MockitoExtension;
    
    /**
     * Unit tests for the {@link SmbFileHandle} interface.
     */
    @ExtendWith(MockitoExtension.class)
    class SmbFileHandleTest {
    
        @Mock
        private SmbFileHandle smbFileHandle;
    
        @Mock
        private SmbTreeHandle smbTreeHandle;
    
        @BeforeEach
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 5.1K bytes
    - Viewed (0)
  9. src/test/java/jcifs/smb/SmbFileHandleImplTest.java

            SmbTreeHandleImpl t1 = h.getTree();
            SmbTreeHandleImpl t2 = h.getTree();
    
            assertSame(tree, t1, "Expected same mocked tree");
            assertSame(tree, t2, "Expected same mocked tree");
    
            // acquire is called once in ctor + once per getTree() call
            verify(tree, times(3)).acquire();
        }
    
        @Test
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 12.3K bytes
    - Viewed (0)
  10. src/test/java/jcifs/internal/smb2/session/Smb2LogoffResponseTest.java

    import jcifs.internal.util.SMBUtil;
    
    @ExtendWith(MockitoExtension.class)
    class Smb2LogoffResponseTest {
    
        // Helper to create an instance with a mocked Configuration
        private Smb2LogoffResponse newResponse() {
            Configuration cfg = Mockito.mock(Configuration.class);
            return new Smb2LogoffResponse(cfg);
        }
    
        @Test
        @DisplayName("Constructor accepts a Configuration and creates instance")
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 4.7K bytes
    - Viewed (0)
Back to top