From 36420fb202f9601b75d5e0a57e93aef6964b7b51 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Mon, 21 Oct 2013 22:23:35 +0200 Subject: [PATCH] Test that a missing timestamp causes the Sone not to be parsed. --- src/test/java/net/pterodactylus/sone/core/SoneParserTest.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/test/java/net/pterodactylus/sone/core/SoneParserTest.java b/src/test/java/net/pterodactylus/sone/core/SoneParserTest.java index 53f11ae..7029048 100644 --- a/src/test/java/net/pterodactylus/sone/core/SoneParserTest.java +++ b/src/test/java/net/pterodactylus/sone/core/SoneParserTest.java @@ -72,6 +72,13 @@ public class SoneParserTest { } @Test + public void verifyThatAMissingTimeCausesAnError() { + Optional sone = soneParser.parseSone(database, originalSone, soneXmlBuilder.removeTime().get()); + assertThat(sone, notNullValue()); + assertThat(sone.isPresent(), is(false)); + } + + @Test public void verifyThatAMissingClientCausesTheOriginalClientToBeUsed() { Optional sone = soneParser.parseSone(database, originalSone, soneXmlBuilder.removeClientInformation().get()); assertThat(sone, notNullValue()); -- 2.7.4