From: David ‘Bombe’ Roden Date: Fri, 21 Aug 2015 22:45:47 +0000 (+0200) Subject: Add method to request detailed plugin info X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=8896f7ed90fe70b0f1f918bb791f094be1b2ebdb;p=jFCPlib.git Add method to request detailed plugin info --- 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",