X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Ftest%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ftext%2FSoneTextParserTest.java;h=34767b520a6727a143c6882cfa4713d339c82d62;hb=1be3820cd48951abbcfd5a7f95b82d44aa0e016a;hp=72860012d04ea0c66e8fd0ca495ce8a5e74b47be;hpb=93bc432d6c92ba3c3c9a843b8bec377266a8bbb3;p=Sone.git diff --git a/src/test/java/net/pterodactylus/sone/text/SoneTextParserTest.java b/src/test/java/net/pterodactylus/sone/text/SoneTextParserTest.java index 7286001..34767b5 100644 --- a/src/test/java/net/pterodactylus/sone/text/SoneTextParserTest.java +++ b/src/test/java/net/pterodactylus/sone/text/SoneTextParserTest.java @@ -20,13 +20,10 @@ package net.pterodactylus.sone.text; import java.io.IOException; import java.io.StringReader; import java.util.Arrays; -import java.util.Collection; -import com.google.common.base.Optional; +import net.pterodactylus.sone.database.memory.MemoryDatabase; import junit.framework.TestCase; -import net.pterodactylus.sone.data.Sone; -import net.pterodactylus.sone.database.SoneProvider; /** * JUnit test case for {@link SoneTextParser}. @@ -47,7 +44,7 @@ public class SoneTextParserTest extends TestCase { */ @SuppressWarnings("static-method") public void testPlainText() throws IOException { - SoneTextParser soneTextParser = new SoneTextParser(null, null); + SoneTextParser soneTextParser = new SoneTextParser(new MemoryDatabase(null)); Iterable parts; /* check basic operation. */ @@ -74,7 +71,7 @@ public class SoneTextParserTest extends TestCase { */ @SuppressWarnings("static-method") public void testKSKLinks() throws IOException { - SoneTextParser soneTextParser = new SoneTextParser(null, null); + SoneTextParser soneTextParser = new SoneTextParser(new MemoryDatabase(null)); Iterable parts; /* check basic links. */ @@ -101,7 +98,7 @@ public class SoneTextParserTest extends TestCase { */ @SuppressWarnings({ "synthetic-access", "static-method" }) public void testEmptyLinesAndSoneLinks() throws IOException { - SoneTextParser soneTextParser = new SoneTextParser(new TestSoneProvider(), null); + SoneTextParser soneTextParser = new SoneTextParser(new MemoryDatabase(null)); Iterable parts; /* check basic links. */ @@ -119,7 +116,7 @@ public class SoneTextParserTest extends TestCase { */ @SuppressWarnings({ "synthetic-access", "static-method" }) public void testEmpyHttpLinks() throws IOException { - SoneTextParser soneTextParser = new SoneTextParser(new TestSoneProvider(), null); + SoneTextParser soneTextParser = new SoneTextParser(new MemoryDatabase(null)); Iterable parts; /* check empty http links. */ @@ -173,54 +170,4 @@ public class SoneTextParserTest extends TestCase { return text.toString(); } - /** - * Mock Sone provider. - * - * @author David ‘Bombe’ Roden - */ - private static class TestSoneProvider implements SoneProvider { - - /** - * {@inheritDoc} - */ - @Override - public Optional getSone(final String soneId) { - return Optional. fromNullable(new Sone(soneId, false) { - - /** - * {@inheritDoc} - */ - @Override - public String getName() { - return soneId; - } - }); - } - - /** - * {@inheritDocs} - */ - @Override - public Collection getSones() { - return null; - } - - /** - * {@inheritDocs} - */ - @Override - public Collection getLocalSones() { - return null; - } - - /** - * {@inheritDocs} - */ - @Override - public Collection getRemoteSones() { - return null; - } - - } - }