Search Options

Results per page
Sort
Preferred Languages
Advance

Results 171 - 180 of 239 for thenReturn (0.05 sec)

  1. src/test/java/jcifs/internal/smb2/session/Smb2SessionSetupResponseTest.java

            // prepare should propagate session id when received
            CIFSContext mockCtx = mock(CIFSContext.class);
            when(mockCtx.getConfig()).thenReturn(mock(Configuration.class));
            Smb2SessionSetupRequest nextReq = new Smb2SessionSetupRequest(mockCtx, 0, 0, 0L, null);
            assertEquals(0L, nextReq.getSessionId());
            resp.prepare(nextReq);
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 9.7K bytes
    - Viewed (0)
  2. src/test/java/jcifs/DecodableTest.java

            // Given
            byte[] buffer = new byte[10];
            int bufferIndex = 0;
            int len = 10;
            when(mockDecodable.decode(buffer, bufferIndex, len)).thenReturn(10);
    
            // When
            int decodedLength = mockDecodable.decode(buffer, bufferIndex, len);
    
            // Then
            assertEquals(10, decodedLength);
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 1K bytes
    - Viewed (0)
  3. src/test/java/jcifs/internal/smb1/com/SmbComSetInformationResponseTest.java

        private Configuration mockConfig;
    
        private SmbComSetInformationResponse response;
    
        @BeforeEach
        void setUp() {
            // Setup mock configuration to avoid NPE
            when(mockConfig.getPid()).thenReturn(12345);
    
            response = new SmbComSetInformationResponse(mockConfig);
        }
    
        @Test
        @DisplayName("Constructor accepts valid config")
        void constructorValid() {
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 07:14:38 UTC 2025
    - 4.1K bytes
    - Viewed (0)
  4. src/test/java/jcifs/internal/smb2/session/Smb2LogoffRequestTest.java

            @Test
            @DisplayName("createResponse returns Smb2LogoffResponse and requests CIFSContext config")
            void createResponse_happyPath() {
                // Arrange
                when(cifsContext.getConfig()).thenReturn(configuration);
                Smb2LogoffRequest req = newRequest();
    
                // Act
                Smb2LogoffResponse resp = req.createResponse(cifsContext, req);
    
                // Assert
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 5.4K bytes
    - Viewed (0)
  5. src/test/java/jcifs/internal/smb1/com/SmbComCreateDirectoryTest.java

        void setUp() {
            // Mock the Configuration object
            mockConfig = mock(Configuration.class);
            // Define behavior for the OEM encoding, which is used by writeString
            when(mockConfig.getOemEncoding()).thenReturn(StandardCharsets.UTF_8.name());
        }
    
        @Test
        void testConstructor() {
            // Test that the constructor correctly sets the command and path
            String directoryName = "testDir";
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 4.2K bytes
    - Viewed (0)
  6. src/test/java/jcifs/netbios/SessionServicePacketTest.java

        void testReadnMultipleCalls() throws IOException {
            when(mockInputStream.read(any(byte[].class), anyInt(), anyInt())).thenReturn(2) // First read returns 2 bytes
                    .thenReturn(2) // Second read returns 2 bytes
                    .thenReturn(1); // Third read returns 1 byte
    
            byte[] buffer = new byte[10];
            int bytesRead = SessionServicePacket.readn(mockInputStream, buffer, 0, 5);
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 15.5K bytes
    - Viewed (0)
  7. android/guava-tests/test/com/google/common/hash/HashingOutputStreamTest.java

      @Override
      protected void setUp() throws Exception {
        super.setUp();
        hasher = mock(Hasher.class);
        hashFunction = mock(HashFunction.class);
    
        when(hashFunction.newHasher()).thenReturn(hasher);
      }
    
      public void testWrite_putSingleByte() throws Exception {
        int b = 'q';
        HashingOutputStream out = new HashingOutputStream(hashFunction, buffer);
        out.write(b);
    
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Dec 19 18:03:30 UTC 2024
    - 3.1K bytes
    - Viewed (0)
  8. src/test/java/jcifs/smb1/dcerpc/ndr/NdrHyperTest.java

        @DisplayName("Decode should set value from NdrBuffer.dec_ndr_hyper")
        public void testDecodeInteraction() throws NdrException {
            NdrBuffer buf = mock(NdrBuffer.class);
            when(buf.dec_ndr_hyper()).thenReturn(0xdeadbeefcafebabeL);
            NdrHyper hyper = new NdrHyper(0L);
            hyper.decode(buf);
            assertEquals(0xdeadbeefcafebabeL, hyper.value);
        }
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 4.3K bytes
    - Viewed (0)
  9. src/test/java/jcifs/smb/HandlerTest.java

        void testOpenConnection_UsesProvidedContext() throws MalformedURLException, IOException {
            // Arrange
            when(mockCtx.getConfig()).thenReturn(mockCfg);
            when(mockCfg.isTraceResourceUsage()).thenReturn(false);
    
            Handler handler = newHandlerWith(mockCtx);
            URL url = new URL(null, "smb://example-host/share/", new Handler());
    
            // Act
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 7.8K bytes
    - Viewed (0)
  10. src/test/java/jcifs/internal/smb2/Smb2EchoRequestTest.java

        @Mock
        private CIFSContext mockContext;
    
        private Smb2EchoRequest echoRequest;
    
        @BeforeEach
        void setUp() {
            MockitoAnnotations.openMocks(this);
            when(mockContext.getConfig()).thenReturn(mockConfig);
            echoRequest = new Smb2EchoRequest(mockConfig);
        }
    
        @Nested
        @DisplayName("Constructor Tests")
        class ConstructorTests {
    
            @Test
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 11.3K bytes
    - Viewed (0)
Back to top