From: David ‘Bombe’ Roden Date: Fri, 16 Oct 2015 06:29:21 +0000 (+0200) Subject: Extract URIGenerated reply to its own method X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=e601f2e7ccb7e1db6b09b3236bc8bedd5fdca255;p=jFCPlib.git Extract URIGenerated reply to its own method --- 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 {