1 package net.pterodactylus.sone.core;
3 import static org.mockito.Matchers.eq;
4 import static org.mockito.Mockito.mock;
5 import static org.mockito.Mockito.verify;
6 import static org.mockito.Mockito.when;
8 import net.pterodactylus.sone.core.SoneDownloader.FetchSone;
9 import net.pterodactylus.sone.data.Sone;
11 import freenet.keys.FreenetURI;
13 import org.junit.Test;
16 * Unit test for {@link SoneDownloader} and its subclasses.
18 * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
20 public class SoneDownloaderTest {
23 public void fetchSoneDownloadsSone() {
24 SoneDownloader soneDownloader = mock(SoneDownloader.class);
25 Sone sone = mock(Sone.class);
26 FreenetURI soneUri = mock(FreenetURI.class);
27 when(sone.getRequestUri()).thenReturn(soneUri);
28 FetchSone fetchSone = soneDownloader.new FetchSone(sone);
30 verify(soneDownloader).fetchSone(eq(sone), eq(soneUri));