@Test public void call_cacheContainsUnexpectedData_willNotBeOverriddenIfNoUpdateAvailable() throws MalformedURLException, IOException { final File cache = folder.newFile("test.cache"); final String unexpectedContent = "unexpected data"; Files.write(unexpectedContent.getBytes(Charsets.UTF_8), cache); assertThat(cache.exists()).isTrue(); final UpdateOperationWithCacheFileTask task = new UpdateOperationWithCacheFileTask(new NotUpdateableXmlDataStore(), cache); task.call(); assertThat(cache.length()).isEqualTo(unexpectedContent.getBytes(Charsets.UTF_8).length); task.call(); assertThat(cache.length()).isEqualTo(unexpectedContent.getBytes(Charsets.UTF_8).length); }
@Override public void call() { readDataIfNewerAvailable(); }
UpdateOperationWithCacheFileTask extends AbstractUpdateOperation { @Override public void call() { readDataIfNewerAvailable(); } }
UpdateOperationWithCacheFileTask extends AbstractUpdateOperation { @Override public void call() { readDataIfNewerAvailable(); } UpdateOperationWithCacheFileTask(@Nonnull final AbstractRefreshableDataStore dataStore, @Nonnull final File cacheFile); }
UpdateOperationWithCacheFileTask extends AbstractUpdateOperation { @Override public void call() { readDataIfNewerAvailable(); } UpdateOperationWithCacheFileTask(@Nonnull final AbstractRefreshableDataStore dataStore, @Nonnull final File cacheFile); @Override void call(); }
UpdateOperationWithCacheFileTask extends AbstractUpdateOperation { @Override public void call() { readDataIfNewerAvailable(); } UpdateOperationWithCacheFileTask(@Nonnull final AbstractRefreshableDataStore dataStore, @Nonnull final File cacheFile); @Override void call();  }