  @Test
  public void shouldReadWholeBuild() throws TimeoutException, InterruptedException {

    // Given
    SymbolsCache symbolsCache = new SymbolsCache(myFixture.getEventDispatcher());
    Mockery m = new Mockery();

    String key = "key";
    BuildMetadataEntry entry = m.mock(BuildMetadataEntry.class, key);

    String key2 = "key2";
    BuildMetadataEntry entry2 = m.mock(BuildMetadataEntry.class, key2);
    List<BuildMetadataEntry> entryList = Arrays.asList(entry, entry2);

    MetadataSource metadataSource = m.mock(MetadataSource.class);
    Long buildId = 123L;

    m.checking(new Expectations(){{
      one(entry).getBuildId();
      will(returnValue(buildId));

      one(entry).getKey();
      will(returnValue(key));

      one(entry2).getKey();
      will(returnValue(key2));

      one(entry2).getBuildId();
      will(returnValue(buildId));

      one(metadataSource).getBuildIdByEntryKey(key);
      will(returnValue(buildId));

      one(metadataSource).getEntriesByBuildId(buildId);
      will(returnValue(entryList));
    }});

    symbolsCache.getEntry(key, metadataSource);

    // When
    BuildMetadataEntry cacheEntry2 = symbolsCache.getEntry(key2, metadataSource);

    // Then
    Assert.assertEquals(cacheEntry2, entry2);
  }