From: David ‘Bombe’ Roden Date: Wed, 4 Sep 2024 11:46:37 +0000 (+0200) Subject: ♻️ Add doNothing() method that can be used to consume a message without doing anything X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=97f54c398e81a35a0df15e13bdc17bb25ce94dd3;p=jFCPlib.git ♻️ Add doNothing() method that can be used to consume a message without doing anything --- 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) {