From 21cc44abe8ffbd1e6d129c2b6141085f0694c5eb Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Mon, 21 Oct 2013 06:50:16 +0200 Subject: [PATCH] Verify that a Sone with a too large protocol version will not be parsed. --- src/test/java/net/pterodactylus/sone/core/SoneParserTest.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/test/java/net/pterodactylus/sone/core/SoneParserTest.java b/src/test/java/net/pterodactylus/sone/core/SoneParserTest.java index dbc0d10..06637c3 100644 --- a/src/test/java/net/pterodactylus/sone/core/SoneParserTest.java +++ b/src/test/java/net/pterodactylus/sone/core/SoneParserTest.java @@ -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()); -- 2.7.4