From: David ‘Bombe’ Roden Date: Wed, 14 Oct 2015 18:57:03 +0000 (+0200) Subject: Use method references instead of lambda expressions X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;ds=sidebyside;h=70d6fa86966eafa1e898c0df0837afff02df6cdb;p=jFCPlib.git Use method references instead of lambda expressions --- diff --git a/src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java b/src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java index 876434f..d4001ba 100644 --- a/src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java +++ b/src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java @@ -1305,7 +1305,7 @@ public class DefaultFcpClientTest { @Test public void reloadingPluginWorks() throws InterruptedException, ExecutionException, IOException { Future> pluginInfo = fcpClient.reloadPlugin().plugin(CLASS_NAME).execute(); - connectAndAssert(() -> matchReloadPluginMessage()); + connectAndAssert(this::matchReloadPluginMessage); replyWithPluginInfo(); verifyPluginInfo(pluginInfo); } @@ -1355,7 +1355,7 @@ public class DefaultFcpClientTest { @Test public void removingPluginWorks() throws InterruptedException, ExecutionException, IOException { Future pluginRemoved = fcpClient.removePlugin().plugin(CLASS_NAME).execute(); - connectAndAssert(() -> matchPluginRemovedMessage()); + connectAndAssert(this::matchPluginRemovedMessage); replyWithPluginRemoved(); assertThat(pluginRemoved.get(), is(true)); } @@ -1402,7 +1402,7 @@ public class DefaultFcpClientTest { @Test public void gettingPluginInfoWorks() throws InterruptedException, ExecutionException, IOException { Future> pluginInfo = fcpClient.getPluginInfo().plugin(CLASS_NAME).execute(); - connectAndAssert(() -> matchGetPluginInfoMessage()); + connectAndAssert(this::matchGetPluginInfoMessage); replyWithPluginInfo(); verifyPluginInfo(pluginInfo); } @@ -1638,7 +1638,7 @@ public class DefaultFcpClientTest { .uri("KSK@foo.txt") .execute(); connectNode(); - readMessage("Hello", () -> matchesDirectClientPut()); + readMessage("Hello", this::matchesDirectClientPut); } @Test @@ -1649,7 +1649,7 @@ public class DefaultFcpClientTest { .uri("KSK@foo.txt") .execute(); connectNode(); - readMessage("Hello", () -> matchesDirectClientPut()); + readMessage("Hello", this::matchesDirectClientPut); replyWithPutFailed("not-the-right-one"); replyWithPutSuccessful(identifier); assertThat(key.get().get().getKey(), is("KSK@foo.txt")); @@ -1663,7 +1663,7 @@ public class DefaultFcpClientTest { .uri("KSK@foo.txt") .execute(); connectNode(); - readMessage("Hello", () -> matchesDirectClientPut()); + readMessage("Hello", this::matchesDirectClientPut); replyWithPutSuccessful("not-the-right-one"); replyWithPutFailed(identifier); assertThat(key.get().isPresent(), is(false)); @@ -1744,7 +1744,7 @@ public class DefaultFcpClientTest { sendDdaRequired(identifier); readMessage(() -> matchesTestDDARequest(ddaFile)); sendTestDDAReply(ddaFile.getParent(), new File(ddaFile + ".foo")); - readMessage(() -> matchesFailedToReadResponse()); + readMessage(this::matchesFailedToReadResponse); } @Test