From e601f2e7ccb7e1db6b09b3236bc8bedd5fdca255 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Fri, 16 Oct 2015 08:29:21 +0200 Subject: [PATCH] Extract URIGenerated reply to its own method --- .../pterodactylus/fcp/quelaton/DefaultFcpClientTest.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java b/src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java index d0ae0e5..c8a834a 100644 --- a/src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java +++ b/src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java @@ -1607,12 +1607,7 @@ public class DefaultFcpClientTest { connectNode(); List lines = fcpServer.collectUntil(is("Hello")); String identifier = extractIdentifier(lines); - fcpServer.writeLine( - "URIGenerated", - "Identifier=" + identifier, - "URI=KSK@foo.txt", - "EndMessage" - ); + replyWithGeneratedUri(); replyWithPutSuccessful(identifier); assertThat(key.get().get().getKey(), is("KSK@foo.txt")); assertThat(generatedKeys, contains("KSK@foo.txt")); @@ -1651,6 +1646,15 @@ public class DefaultFcpClientTest { ); } + private void replyWithGeneratedUri() throws IOException { + fcpServer.writeLine( + "URIGenerated", + "Identifier=" + identifier, + "URI=KSK@foo.txt", + "EndMessage" + ); + } + private void replyWithSimpleProgress( int total, int required, int failed, int fatallyFailed, int succeeded, int lastProgress, boolean finalizedTotal, int minSuccessFetchBlocks) throws IOException { -- 2.7.4