Add unit test for the insert token supplier.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 1 Aug 2014 00:22:30 +0000 (02:22 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 1 Aug 2014 00:22:30 +0000 (02:22 +0200)
src/test/java/net/pterodactylus/sone/core/FreenetInterfaceTest.java

index 9e8852b..486b177 100644 (file)
@@ -34,6 +34,7 @@ import net.pterodactylus.sone.TestUtil;
 import net.pterodactylus.sone.core.FreenetInterface.Callback;
 import net.pterodactylus.sone.core.FreenetInterface.Fetched;
 import net.pterodactylus.sone.core.FreenetInterface.InsertToken;
+import net.pterodactylus.sone.core.FreenetInterface.InsertTokenSupplier;
 import net.pterodactylus.sone.core.event.ImageInsertStartedEvent;
 import net.pterodactylus.sone.data.Image;
 import net.pterodactylus.sone.data.ImageImpl;
@@ -337,4 +338,11 @@ public class FreenetInterfaceTest {
                assertThat(fetched.getFetchResult(), is(fetchResult));
        }
 
+       @Test
+       public void insertTokenSupplierSuppliesInsertTokens() {
+               InsertTokenSupplier insertTokenSupplier = freenetInterface.new InsertTokenSupplier();
+               Image image = mock(Image.class);
+               assertThat(insertTokenSupplier.apply(image), notNullValue());
+       }
+
 }