From: David ‘Bombe’ Roden Date: Fri, 6 Sep 2024 21:10:40 +0000 (+0200) Subject: ✅ Make tests more realistic by running listeners in a different thread X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=69072a5a254383f37545b4babfdeef76ecf986aa;p=jFCPlib.git ✅ Make tests more realistic by running listeners in a different thread --- diff --git a/src/test/java/net/pterodactylus/fcp/highlevel/FcpClientTest.java b/src/test/java/net/pterodactylus/fcp/highlevel/FcpClientTest.java index e86bb85..92a0e4b 100644 --- a/src/test/java/net/pterodactylus/fcp/highlevel/FcpClientTest.java +++ b/src/test/java/net/pterodactylus/fcp/highlevel/FcpClientTest.java @@ -528,7 +528,7 @@ public class FcpClientTest { @Override public void sendMessage(FcpMessage fcpMessage) { BiConsumer listenerNotifier = messageConsumer.apply(fcpMessage); - listeners.forEach(listener -> listenerNotifier.accept(listener, this)); + new Thread(() -> listeners.forEach(listener -> listenerNotifier.accept(listener, this))).start(); } }; }