From 97f54c398e81a35a0df15e13bdc17bb25ce94dd3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 4 Sep 2024 13:46:37 +0200 Subject: [PATCH] =?utf8?q?=E2=99=BB=EF=B8=8F=20Add=20doNothing()=20method?= =?utf8?q?=20that=20can=20be=20used=20to=20consume=20a=20message=20without?= =?utf8?q?=20doing=20anything?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../java/net/pterodactylus/fcp/highlevel/FcpClientTest.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/test/java/net/pterodactylus/fcp/highlevel/FcpClientTest.java b/src/test/java/net/pterodactylus/fcp/highlevel/FcpClientTest.java index b8028a6..cf0ddd2 100644 --- a/src/test/java/net/pterodactylus/fcp/highlevel/FcpClientTest.java +++ b/src/test/java/net/pterodactylus/fcp/highlevel/FcpClientTest.java @@ -151,8 +151,7 @@ public class FcpClientTest { if (message.getName().equals("GenerateSSK")) { return ((listener, connection) -> listener.receivedSSKKeypair(connection, new SSKKeypair(new FcpMessage("SSKKeypair").put("InsertURI", "insert-uri").put("RequestURI", "request-uri")))); } - return (l, c) -> { - }; + return FcpClientTest::doNothing; }); try (FcpClient fcpClient = new FcpClient(fcpConnection)) { SSKKeypair keypair = fcpClient.generateKeyPair(); @@ -161,9 +160,12 @@ public class FcpClientTest { } } + private static void doNothing(FcpListener listener, FcpConnection connection) { + // do nothing. + } + private static FcpConnection createFcpConnection() { - return createFcpConnection(m -> (l, c) -> { - }); + return createFcpConnection(m -> FcpClientTest::doNothing); } private static FcpConnection createFcpConnection(Function> messageConsumer) { -- 2.7.4