Move test string creation into its own method.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 25 Oct 2013 17:29:39 +0000 (19:29 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 28 Feb 2014 21:25:39 +0000 (22:25 +0100)
src/test/java/net/pterodactylus/sone/fcp/AbstractSoneCommandTest.java

index 434702b..b2d7556 100644 (file)
@@ -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();
        }
 
 }