X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Ftest%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fcore%2FSoneParserTest.java;h=87f66009b7d50db6b0aac5c908406c6ad12a574e;hb=1c10b9c10e4888d4b29767ae28afaf679e6384bf;hp=dd4895409dfa0a4c44fbce9f92782f60f4eb29ca;hpb=b26783f7cdca8c6258c70bef0523758d11c21707;p=Sone.git diff --git a/src/test/java/net/pterodactylus/sone/core/SoneParserTest.java b/src/test/java/net/pterodactylus/sone/core/SoneParserTest.java index dd48954..87f6600 100644 --- a/src/test/java/net/pterodactylus/sone/core/SoneParserTest.java +++ b/src/test/java/net/pterodactylus/sone/core/SoneParserTest.java @@ -122,7 +122,7 @@ public class SoneParserTest { @Test(expected = MalformedTime.class) public void verifyThatAMalformedTimeCausesAnError() { - soneParser.parseSone(database, originalSone, getXml("invalid-time")); + soneParser.parseSone(database, originalSone, getXml("invalid-post-time")); } @Test @@ -141,6 +141,26 @@ public class SoneParserTest { } @Test + public void verifyThatAMissingPostLikesSectionDoesNotCauseAnError() { + soneParser.parseSone(database, originalSone, getXml("missing-post-likes")); + } + + @Test + public void verifyThatAMissingReplyLikesSectionDoesNotCauseAnError() { + soneParser.parseSone(database, originalSone, getXml("missing-reply-likes")); + } + + @Test + public void verifyThatMissingAlbumsSectionDoNotCauseAnError() { + soneParser.parseSone(database, originalSone, getXml("missing-albums")); + } + + @Test(expected = MalformedXml.class) + public void verifyThatAnInvalidAlbumCausesAnError() { + soneParser.parseSone(database, originalSone, getXml("invalid-album")); + } + + @Test public void verifyThatAnEmptyProfileIsParsedWithoutError() { Sone sone = soneParser.parseSone(database, originalSone, getXml("empty-profile")); assertThat(sone.getProfile().getFirstName(), nullValue());