Verify that a Sone with a too large protocol version will not be parsed.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 21 Oct 2013 04:50:16 +0000 (06:50 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 28 Feb 2014 21:25:32 +0000 (22:25 +0100)
src/test/java/net/pterodactylus/sone/core/SoneParserTest.java

index dbc0d10..06637c3 100644 (file)
@@ -56,6 +56,11 @@ public class SoneParserTest {
        }
 
        @Test
+       public void verifyThatATooLargeProtocolVersionCausesAnError() throws SoneException {
+               assertThat(soneParser.parseSone(database, originalSone, soneXmlBuilder.setProtocolVersion("1").get()), nullValue());
+       }
+
+       @Test
        public void verifyThatAMissingClientCausesTheOriginalClientToBeUsed() throws SoneException {
                Sone sone = soneParser.parseSone(database, originalSone, soneXmlBuilder.removeClientInformation().get());
                assertThat(sone, notNullValue());