From: David ‘Bombe’ Roden Date: Thu, 9 Jul 2015 05:09:49 +0000 (+0200) Subject: Add test for protocol error 25 for different identifier X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=f01de7273b8072cd51f3c92afa2cb7dafba97d16;p=jFCPlib.git Add test for protocol error 25 for different identifier --- diff --git a/src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java b/src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java index f26fff4..0fbb7b8 100644 --- a/src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java +++ b/src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java @@ -435,4 +435,26 @@ public class DefaultFcpClientTest { return tempFile; } + @Test + public void clientPutDoesNotReactToProtocolErrorForDifferentIdentifier() + throws InterruptedException, ExecutionException, IOException { + Future> key = fcpClient.clientPut().from(new File("/tmp/data.txt")).key(new Key("KSK@foo.txt")); + connectNode(); + List lines = fcpServer.collectUntil(is("EndMessage")); + String identifier = extractIdentifier(lines); + fcpServer.writeLine( + "ProtocolError", + "Identifier=not-the-right-one", + "Code=25", + "EndMessage" + ); + fcpServer.writeLine( + "PutSuccessful", + "Identifier=" + identifier, + "URI=KSK@foo.txt", + "EndMessage" + ); + assertThat(key.get().get().getKey(), is("KSK@foo.txt")); + } + }