Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 231 - 240 of 256 for thenReturn (0.07 seconds)

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

            // Spy to override getPasswordAsCharArray() to return null
            JAASAuthenticator spyAuth = spy(new JAASAuthenticator("DOM", "user", null));
            when(spyAuth.getPasswordAsCharArray()).thenReturn(null);
    
            PasswordCallback pc = new PasswordCallback("pass:", false);
            spyAuth.handle(new Callback[] { pc });
    
            // Since getPasswordAsCharArray() returned null, handler should not set a password
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Sat Aug 30 05:58:03 GMT 2025
    - 9.9K bytes
    - Click Count (0)
  2. src/test/java/jcifs/internal/smb1/com/SmbComSeekResponseTest.java

        @Mock
        private Configuration mockConfig;
    
        private SmbComSeekResponse response;
    
        @BeforeEach
        void setUp() {
            // Setup mock configuration to avoid NPE
            when(mockConfig.getPid()).thenReturn(12345);
            response = new SmbComSeekResponse(mockConfig);
        }
    
        /* ------------------------------------------------------------------ */
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Thu Aug 14 05:31:44 GMT 2025
    - 8.1K bytes
    - Click Count (0)
  3. src/test/java/jcifs/internal/smb2/lock/Smb2LockRequestTest.java

        private Smb2Lock[] testLocks;
        private Smb2LockRequest request;
    
        @BeforeEach
        void setUp() {
            MockitoAnnotations.openMocks(this);
            when(mockContext.getConfig()).thenReturn(mockConfig);
    
            testFileId = new byte[16];
            new SecureRandom().nextBytes(testFileId);
    
            testLocks = new Smb2Lock[] { new Smb2Lock(0L, 100L, Smb2Lock.SMB2_LOCKFLAG_EXCLUSIVE_LOCK) };
    
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Thu Aug 14 05:31:44 GMT 2025
    - 25.3K bytes
    - Click Count (0)
  4. src/test/java/jcifs/smb1/util/transport/TransportExceptionTest.java

            void testCircularReferenceInRootCause() {
                // Create a mock exception that could have circular reference
                Exception rootCause = mock(Exception.class);
                when(rootCause.getMessage()).thenReturn("Mocked exception");
    
                TransportException exception = new TransportException("Test", rootCause);
    
                assertEquals(rootCause, exception.getRootCause());
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Thu Aug 14 05:31:44 GMT 2025
    - 11.5K bytes
    - Click Count (0)
  5. src/test/java/jcifs/internal/smb1/com/SmbComNegotiateResponseTest.java

        }
    
        @Test
        public void testIsValid() {
            SmbNegotiationRequest request = mock(SmbNegotiationRequest.class);
            when(request.isSigningEnforced()).thenReturn(true);
            response.getServerData().signaturesEnabled = true;
    
            assertTrue(response.isValid(mockContext, request));
            assertTrue(response.isSigningNegotiated());
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Thu Aug 14 05:31:44 GMT 2025
    - 11.4K bytes
    - Click Count (0)
  6. src/test/java/jcifs/internal/smb1/trans2/Trans2GetDfsReferralTest.java

            // Mock the request buffer
            DfsReferralRequestBuffer mockRequest = mock(DfsReferralRequestBuffer.class);
            when(mockRequest.encode(any(byte[].class), anyInt())).thenReturn(10);
    
            // Inject mock request
            Field requestField = Trans2GetDfsReferral.class.getDeclaredField("request");
            requestField.setAccessible(true);
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Thu Aug 14 05:31:44 GMT 2025
    - 11K bytes
    - Click Count (0)
  7. src/test/java/jcifs/internal/smb2/Smb2SigningDigestTest.java

                    mockedKeyDerivation.when(
                            () -> Smb3KeyDerivation.deriveSigningKey(eq(Smb2Constants.SMB2_DIALECT_0300), any(byte[].class), any(byte[].class)))
                            .thenReturn(derivedKey);
    
                    Smb2SigningDigest digest = new Smb2SigningDigest(sessionKey, Smb2Constants.SMB2_DIALECT_0300, null);
                    assertNotNull(digest);
    
                    mockedKeyDerivation.verify(
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Sat Aug 30 05:58:03 GMT 2025
    - 43.7K bytes
    - Click Count (0)
  8. src/test/java/jcifs/smb/SmbTreeConnectionTraceTest.java

        void getConfig_delegatesToContext() {
            // Arrange
            CIFSContext ctx = mock(CIFSContext.class);
            Configuration cfg = mock(Configuration.class);
            when(ctx.getConfig()).thenReturn(cfg);
            SmbTreeConnectionTrace trace = new SmbTreeConnectionTrace(ctx);
    
            // Act
            Configuration result = trace.getConfig();
    
            // Assert
            assertSame(cfg, result);
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Thu Aug 14 05:31:44 GMT 2025
    - 8.7K bytes
    - Click Count (0)
  9. guava-tests/test/com/google/common/collect/ImmutableSortedMultisetTest.java

        TestHashSet<Entry<String>> entrySet = new TestHashSet<>();
        when((Comparator<Comparable<String>>) toCopy.comparator())
            .thenReturn(Ordering.<Comparable<String>>natural());
        when(toCopy.entrySet()).thenReturn(entrySet);
        ImmutableSortedMultiset<String> unused = ImmutableSortedMultiset.copyOfSorted(toCopy);
        assertTrue(entrySet.toArrayCalled);
      }
    
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Fri Mar 13 13:01:07 GMT 2026
    - 22.8K bytes
    - Click Count (0)
  10. src/test/java/jcifs/http/HandlerTest.java

            };
    
            URL url = new URL("http://custom.protocol/path");
    
            // Configure the mock factory to return our handler for the 'http' protocol.
            when(mockFactory.createURLStreamHandler("http")).thenReturn(mockStreamHandler);
    
            Handler.setURLStreamHandlerFactory(mockFactory);
    
            URLConnection connection = handler.openConnection(url);
    
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Thu Aug 14 05:31:44 GMT 2025
    - 11.1K bytes
    - Click Count (0)
Back to Top