@Override public ImmutableType call() throws Exception { return hashIndexer.lookup(hash); } });
@Test public void find() throws Exception { String hash = "hash"; when(hashIndexer.lookup(hash)).thenReturn(type); ImmutableType type = lookup.findByHash(hash); assertThat((Type) type, is(type)); verify(hashIndexer, times(1)).lookup(hash); verify(classCache, times(1)).executeWithReadLock(Matchers.<Callable<?>> anyObject()); verifyNoMoreInteractions(hashIndexer, classCache); verifyZeroInteractions(fqnIndexer); } }