From: David ‘Bombe’ Roden Date: Fri, 16 Oct 2015 06:30:18 +0000 (+0200) Subject: Use reply-with-successful where appropriate X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=002ccd34749862f5e43376d8c8518f4dc0c3f0bc;p=jFCPlib.git Use reply-with-successful where appropriate --- diff --git a/src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java b/src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java index c8a834a..77573c0 100644 --- a/src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java +++ b/src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java @@ -1605,8 +1605,7 @@ public class DefaultFcpClientTest { .uri("KSK@foo.txt") .execute(); connectNode(); - List lines = fcpServer.collectUntil(is("Hello")); - String identifier = extractIdentifier(lines); + readMessage("Hello", this::matchesDirectClientPut); replyWithGeneratedUri(); replyWithPutSuccessful(identifier); assertThat(key.get().get().getKey(), is("KSK@foo.txt")); @@ -1699,8 +1698,8 @@ public class DefaultFcpClientTest { connectAndAssert(() -> matchesClientPutDiskDir("Verbosity=1")); replyWithSimpleProgress(1, 2, 3, 4, 5, 6, true, 8); replyWithSimpleProgress(11, 12, 13, 14, 15, 16, false, 18); - fcpServer.writeLine("PutSuccessful", "Identifier=" + identifier, "URI=CHK@abc", "EndMessage"); - assertThat(key.get().get().getKey(), is("CHK@abc")); + replyWithPutSuccessful(identifier); + assertThat(key.get().get().getKey(), is("KSK@foo.txt")); assertThat(requestProgress, contains( isRequestProgress(1, 2, 3, 4, 5, 6, true, 8), isRequestProgress(11, 12, 13, 14, 15, 16, false, 18)