From 02ab574b5554f822f0b1899eac24c4229c83e263 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 15 Oct 2015 21:21:06 +0200 Subject: [PATCH] Add test for protocol error when reloading plugin --- .../net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java b/src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java index 8adf900..b21e15e 100644 --- a/src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java +++ b/src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java @@ -1030,6 +1030,15 @@ public class DefaultFcpClientTest { verifyPluginInfo(pluginInfo); } + @Test + public void protocolErrorIsRecognizedAsFailure() + throws InterruptedException, ExecutionException, IOException { + Future> pluginInfo = fcpClient.reloadPlugin().plugin(CLASS_NAME).execute(); + connectAndAssert(() -> matchReloadPluginMessage()); + replyWithProtocolError(); + assertThat(pluginInfo.get().isPresent(), is(false)); + } + private Matcher> matchReloadPluginMessage() { return matchesFcpMessage( "ReloadPlugin", -- 2.7.4