From 03467b3e49c79fff218d1b1e65339bbabdcbcaad Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Fri, 25 Oct 2013 19:29:39 +0200 Subject: [PATCH] Move test string creation into its own method. --- .../net/pterodactylus/sone/fcp/AbstractSoneCommandTest.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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(); } } -- 2.7.4