Search Options

Results per page
Sort
Preferred Languages
Advance

Results 181 - 190 of 239 for thenReturn (0.05 sec)

  1. src/test/java/jcifs/internal/TreeConnectResponseTest.java

            }
    
            @Test
            @DisplayName("Should return tree ID")
            void testGetTid() {
                // Given
                when(mockResponse.getTid()).thenReturn(12345);
    
                // When
                int tid = mockResponse.getTid();
    
                // Then
                assertEquals(12345, tid, "Should return the configured tree ID");
                verify(mockResponse).getTid();
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 24.9K bytes
    - Viewed (0)
  2. src/test/java/jcifs/internal/smb1/trans2/Trans2QueryPathInformationTest.java

            assertEquals(0x0101, SMBUtil.readInt2(paramBuffer, 0));
        }
    
        @Test
        void testWithMockConfiguration() {
            when(mockConfig.getMinimumVersion()).thenReturn(jcifs.DialectVersion.SMB1);
            when(mockConfig.getMaximumVersion()).thenReturn(jcifs.DialectVersion.SMB311);
    
            trans2QueryPathInfo = new Trans2QueryPathInformation(mockConfig, TEST_FILENAME, TEST_INFO_LEVEL);
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 12.4K bytes
    - Viewed (0)
  3. src/test/java/jcifs/http/NtlmHttpServletRequestTest.java

         */
        @Test
        void testGetRemoteUser() {
            // Arrange: Define the expected user name from the principal
            String expectedUserName = "testUser";
            when(mockPrincipal.getName()).thenReturn(expectedUserName);
    
            // Act: Call the method under test
            String actualUserName = ntlmRequest.getRemoteUser();
    
            // Assert: Verify that the returned user name is the expected one
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 21 04:51:33 UTC 2025
    - 2.7K bytes
    - Viewed (0)
  4. src/test/java/jcifs/internal/smb2/create/CreateContextResponseTest.java

                byte[] expectedName = "TEST_CONTEXT".getBytes(StandardCharsets.UTF_8);
                CreateContextResponse response = mock(CreateContextResponse.class);
                when(response.getName()).thenReturn(expectedName);
    
                byte[] actualName = response.getName();
                assertArrayEquals(expectedName, actualName);
                verify(response, times(1)).getName();
            }
    
            @Test
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 16.2K bytes
    - Viewed (0)
  5. src/test/java/jcifs/ntlmssp/av/AvSingleHostTest.java

            Configuration mockConfig = mock(Configuration.class);
            byte[] expectedMachineId = new byte[32];
            expectedMachineId[0] = 0x0A;
            expectedMachineId[1] = 0x0B;
            when(mockConfig.getMachineId()).thenReturn(expectedMachineId);
    
            AvSingleHost avSingleHost = new AvSingleHost(mockConfig);
    
            assertNotNull(avSingleHost);
            assertEquals(AvPair.MsvAvSingleHost, avSingleHost.getType());
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 6.4K bytes
    - Viewed (0)
  6. src/test/java/jcifs/smb/DfsReferralTest.java

            DfsReferralData mockData = mock(DfsReferralData.class);
            String expectedToString = "Mock DfsReferralData";
    
            // Define the behavior of the mock's toString() method
            when(mockData.toString()).thenReturn(expectedToString);
    
            // Create a DfsReferral instance with the mock data
            DfsReferral dfsReferral = new DfsReferral(mockData);
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 1.6K bytes
    - Viewed (0)
  7. src/test/java/jcifs/smb/BufferCacheImplTest.java

        void constructorUsesConfigurationAndAllocatesWithConfiguredSize() {
            when(cfg.getBufferCacheSize()).thenReturn(2);
            when(cfg.getMaximumBufferSize()).thenReturn(5);
    
            BufferCacheImpl impl = new BufferCacheImpl(cfg);
    
            // Verify interactions happen exactly once during construction
            verify(cfg, times(1)).getBufferCacheSize();
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 7.5K bytes
    - Viewed (0)
  8. src/test/java/jcifs/dcerpc/ndr/NdrSmallTest.java

        }
    
        @Test
        void testDecode() throws NdrException {
            // Define the value that dec_ndr_small should return
            int decodedValue = 200;
            when(mockNdrBuffer.dec_ndr_small()).thenReturn(decodedValue);
    
            // Create an NdrSmall object (initial value doesn't matter for decode)
            NdrSmall ndrSmall = new NdrSmall(0);
    
            // Call the decode method
            ndrSmall.decode(mockNdrBuffer);
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 3.2K bytes
    - Viewed (0)
  9. src/test/java/jcifs/pac/PacTest.java

                // Mock the calculateMac method to return a valid checksum
                byte[] mockChecksum = new byte[16];
                pacMacMock.when(() -> PacMac.calculateMac(anyInt(), any(), any())).thenReturn(mockChecksum);
    
                // Create a minimal valid PAC structure
                ByteArrayOutputStream baos = new ByteArrayOutputStream();
                writeLittleEndianInt(baos, 3); // bufferCount = 3 (minimum required)
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 7.9K bytes
    - Viewed (0)
  10. src/test/java/jcifs/smb/SmbFilenameFilterTest.java

        @DisplayName("filter can use SmbFile directory for decision logic")
        void filterCanUseSmbFileForDecision() throws Exception {
            // Stub the getPath method to return a specific value
            when(mockDir.getPath()).thenReturn("/share/folder/");
    
            // Implementation uses dir.getPath() to check if file should be in that path
            SmbFilenameFilter filter = (dir, name) -> {
                if (dir == null)
                    return false;
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 7.3K bytes
    - Viewed (0)
Back to top