Test that a missing timestamp causes the Sone not to be parsed.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 21 Oct 2013 20:23:35 +0000 (22:23 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 28 Feb 2014 21:25:33 +0000 (22:25 +0100)
src/test/java/net/pterodactylus/sone/core/SoneParserTest.java

index 53f11ae..7029048 100644 (file)
@@ -72,6 +72,13 @@ public class SoneParserTest {
        }
 
        @Test
+       public void verifyThatAMissingTimeCausesAnError() {
+               Optional<Sone> sone = soneParser.parseSone(database, originalSone, soneXmlBuilder.removeTime().get());
+               assertThat(sone, notNullValue());
+               assertThat(sone.isPresent(), is(false));
+       }
+
+       @Test
        public void verifyThatAMissingClientCausesTheOriginalClientToBeUsed() {
                Optional<Sone> sone = soneParser.parseSone(database, originalSone, soneXmlBuilder.removeClientInformation().get());
                assertThat(sone, notNullValue());