Use reply-with-successful where appropriate
authorDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Fri, 16 Oct 2015 06:30:18 +0000 (08:30 +0200)
committerDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Fri, 16 Oct 2015 06:30:18 +0000 (08:30 +0200)
src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java

index c8a834a..77573c0 100644 (file)
@@ -1605,8 +1605,7 @@ public class DefaultFcpClientTest {
                                        .uri("KSK@foo.txt")
                                        .execute();
                                connectNode();
-                               List<String> 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)