- assertThat(downloadTriggered.await(1, SECONDS), is(true));
- }
-
- @Test
- public void callbackForRegisteredSoneWithTheSameEditionDoesNotTriggerDownload() throws InterruptedException {
- freenetInterface.registerUsk(sone, soneDownloader);
- final CountDownLatch downloadTriggered = new CountDownLatch(1);
- doAnswer(new Answer<Void>() {
- @Override
- public Void answer(InvocationOnMock invocation) throws Throwable {
- downloadTriggered.countDown();
- return null;
- }
- }).when(soneDownloader).fetchSone(sone);
- callbackCaptor.getValue().onFoundEdition(0, null, null, null, false, (short) 0, null, false, false);
- assertThat(downloadTriggered.await(1, SECONDS), is(false));