Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 13 for thenReturn (0.22 sec)

  1. guava-tests/test/com/google/common/cache/ForwardingLoadingCacheTest.java

        when(mock.get("key")).thenReturn(Boolean.TRUE);
        assertSame(Boolean.TRUE, forward.get("key"));
      }
    
      public void testGetUnchecked() {
        when(mock.getUnchecked("key")).thenReturn(Boolean.TRUE);
        assertSame(Boolean.TRUE, forward.getUnchecked("key"));
      }
    
      public void testGetAll() throws ExecutionException {
        when(mock.getAll(ImmutableList.of("key"))).thenReturn(ImmutableMap.of("key", Boolean.TRUE));
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Apr 17 12:41:04 GMT 2023
    - 3.4K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/collect/ConcurrentHashMultisetTest.java

        // next map.get()
        when(backingMap.get(KEY)).thenReturn(existingZero);
        // since get returned zero, try a replace; that fails due to a simulated race
        when(backingMap.replace(eq(KEY), eq(existingZero), isA(AtomicInteger.class))).thenReturn(false);
        when(backingMap.putIfAbsent(eq(KEY), isA(AtomicInteger.class))).thenReturn(existing);
    
        // another map.get()
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 14.2K bytes
    - Viewed (0)
  3. guava-tests/test/com/google/common/util/concurrent/MoreExecutorsTest.java

        ExecutorService service = mock(ExecutorService.class);
        when(service.awaitTermination(HALF_SECOND_NANOS, NANOSECONDS))
            .thenReturn(false)
            .thenReturn(true);
        when(service.isTerminated()).thenReturn(true);
        assertTrue(shutdownAndAwaitTermination(service, 1L, SECONDS));
        verify(service).shutdown();
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 28.2K bytes
    - Viewed (3)
  4. android/guava-tests/test/com/google/common/cache/ForwardingLoadingCacheTest.java

        when(mock.get("key")).thenReturn(Boolean.TRUE);
        assertSame(Boolean.TRUE, forward.get("key"));
      }
    
      public void testGetUnchecked() {
        when(mock.getUnchecked("key")).thenReturn(Boolean.TRUE);
        assertSame(Boolean.TRUE, forward.getUnchecked("key"));
      }
    
      public void testGetAll() throws ExecutionException {
        when(mock.getAll(ImmutableList.of("key"))).thenReturn(ImmutableMap.of("key", Boolean.TRUE));
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Apr 17 12:41:04 GMT 2023
    - 3.4K bytes
    - Viewed (0)
  5. android/guava-tests/test/com/google/common/collect/ConcurrentHashMultisetTest.java

        // next map.get()
        when(backingMap.get(KEY)).thenReturn(existingZero);
        // since get returned zero, try a replace; that fails due to a simulated race
        when(backingMap.replace(eq(KEY), eq(existingZero), isA(AtomicInteger.class))).thenReturn(false);
        when(backingMap.putIfAbsent(eq(KEY), isA(AtomicInteger.class))).thenReturn(existing);
    
        // another map.get()
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 14.2K bytes
    - Viewed (0)
  6. 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);
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Fri Oct 02 16:24:50 GMT 2020
    - 3.1K bytes
    - Viewed (0)
  7. guava-tests/test/com/google/common/cache/ForwardingCacheTest.java

        verify(mock).invalidateAll();
      }
    
      public void testSize() {
        when(mock.size()).thenReturn(0L);
        assertEquals(0, forward.size());
      }
    
      public void testStats() {
        when(mock.stats()).thenReturn(null);
        assertNull(forward.stats());
      }
    
      public void testAsMap() {
        when(mock.asMap()).thenReturn(null);
        assertNull(forward.asMap());
      }
    
      public void testCleanUp() {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Apr 17 12:41:04 GMT 2023
    - 3.1K bytes
    - Viewed (0)
  8. android/guava-tests/test/com/google/common/cache/ForwardingCacheTest.java

        verify(mock).invalidateAll();
      }
    
      public void testSize() {
        when(mock.size()).thenReturn(0L);
        assertEquals(0, forward.size());
      }
    
      public void testStats() {
        when(mock.stats()).thenReturn(null);
        assertNull(forward.stats());
      }
    
      public void testAsMap() {
        when(mock.asMap()).thenReturn(null);
        assertNull(forward.asMap());
      }
    
      public void testCleanUp() {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Apr 17 12:41:04 GMT 2023
    - 3.1K bytes
    - Viewed (0)
  9. android/guava-tests/test/com/google/common/util/concurrent/MoreExecutorsTest.java

        ExecutorService service = mock(ExecutorService.class);
        when(service.awaitTermination(HALF_SECOND_NANOS, NANOSECONDS))
            .thenReturn(false)
            .thenReturn(true);
        when(service.isTerminated()).thenReturn(true);
        assertTrue(shutdownAndAwaitTermination(service, 1L, SECONDS));
        verify(service).shutdown();
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 28.2K bytes
    - Viewed (0)
  10. android/guava-tests/test/com/google/common/hash/HashingInputStreamTest.java

        super.setUp();
        hasher = mock(Hasher.class);
        hashFunction = mock(HashFunction.class);
        buffer = new ByteArrayInputStream(testBytes);
    
        when(hashFunction.newHasher()).thenReturn(hasher);
      }
    
      public void testRead_putSingleByte() throws Exception {
        HashingInputStream in = new HashingInputStream(hashFunction, buffer);
    
        int b = in.read();
        assertEquals('y', b);
    
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Fri Oct 02 16:24:50 GMT 2020
    - 5K bytes
    - Viewed (0)
Back to top