From 8896f7ed90fe70b0f1f918bb791f094be1b2ebdb Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 22 Aug 2015 00:45:47 +0200 Subject: [PATCH] Add method to request detailed plugin info --- .../net/pterodactylus/fcp/quelaton/GetPluginInfoCommand.java | 1 + .../pterodactylus/fcp/quelaton/GetPluginInfoCommandImpl.java | 6 ++++++ .../net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java | 10 ++++++++++ 3 files changed, 17 insertions(+) diff --git a/src/main/java/net/pterodactylus/fcp/quelaton/GetPluginInfoCommand.java b/src/main/java/net/pterodactylus/fcp/quelaton/GetPluginInfoCommand.java index 047024b..03e887c 100644 --- a/src/main/java/net/pterodactylus/fcp/quelaton/GetPluginInfoCommand.java +++ b/src/main/java/net/pterodactylus/fcp/quelaton/GetPluginInfoCommand.java @@ -11,6 +11,7 @@ import net.pterodactylus.fcp.PluginInfo; */ public interface GetPluginInfoCommand { + GetPluginInfoCommand detailed(); Executable> plugin(String pluginName); } diff --git a/src/main/java/net/pterodactylus/fcp/quelaton/GetPluginInfoCommandImpl.java b/src/main/java/net/pterodactylus/fcp/quelaton/GetPluginInfoCommandImpl.java index 8063bc7..67c3e30 100644 --- a/src/main/java/net/pterodactylus/fcp/quelaton/GetPluginInfoCommandImpl.java +++ b/src/main/java/net/pterodactylus/fcp/quelaton/GetPluginInfoCommandImpl.java @@ -33,6 +33,12 @@ public class GetPluginInfoCommandImpl implements GetPluginInfoCommand { } @Override + public GetPluginInfoCommand detailed() { + getPluginInfo.setDetailed(true); + return this; + } + + @Override public Executable> plugin(String pluginName) { getPluginInfo.setPluginName(pluginName); return this::execute; diff --git a/src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java b/src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java index 002086d..78aa52a 100644 --- a/src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java +++ b/src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java @@ -2250,6 +2250,16 @@ public class DefaultFcpClientTest { verifyPluginInfo(pluginInfo); } + @Test + public void gettingPluginInfoWithDetailsWorks() + throws InterruptedException, ExecutionException, IOException { + Future> pluginInfo = + fcpClient.getPluginInfo().detailed().plugin(CLASS_NAME).execute(); + connectAndAssert(() -> allOf(matchGetPluginInfoMessage(), hasItem("Detailed=true"))); + replyWithPluginInfo(); + verifyPluginInfo(pluginInfo); + } + private Matcher> matchGetPluginInfoMessage() { return matchesFcpMessage( "GetPluginInfo", -- 2.7.4