From: David ‘Bombe’ Roden Date: Fri, 25 Oct 2013 17:29:39 +0000 (+0200) Subject: Move test string creation into its own method. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=03467b3e49c79fff218d1b1e65339bbabdcbcaad;p=Sone.git Move test string creation into its own method. --- diff --git a/src/test/java/net/pterodactylus/sone/fcp/AbstractSoneCommandTest.java b/src/test/java/net/pterodactylus/sone/fcp/AbstractSoneCommandTest.java index 434702b..b2d7556 100644 --- a/src/test/java/net/pterodactylus/sone/fcp/AbstractSoneCommandTest.java +++ b/src/test/java/net/pterodactylus/sone/fcp/AbstractSoneCommandTest.java @@ -33,13 +33,19 @@ public class AbstractSoneCommandTest { @Test public void testStringEncoding() { + String testString = prepareStringToBeEncoded(); + + String encodedString = encodeString(testString); + assertThat(encodedString, notNullValue()); + assertThat(encodedString.length(), is(testString.length() + 3)); + } + + private String prepareStringToBeEncoded() { StringBuilder testString = new StringBuilder(); for (int i = 0; i < 4000; ++i) { testString.append((char) i); } - String encodedString = encodeString(testString.toString()); - assertThat(encodedString, notNullValue()); - assertThat(encodedString.length(), is(testString.length() + 3)); + return testString.toString(); } }