X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Ftest%2Fjava%2Fnet%2Fpterodactylus%2Ffcp%2Fquelaton%2FDefaultFcpClientTest.java;h=d4d67c546af337a49f70cad76882092dfde89206;hb=d21f485b5918b4281c349d8c04893d27a979ae76;hp=7ba009cfa9345dfe22a43a2059f2e0dbdd0c2805;hpb=26fe1c162b89b0dbd9505b538a5daf527599be54;p=jFCPlib.git diff --git a/src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java b/src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java index 7ba009c..d4d67c5 100644 --- a/src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java +++ b/src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java @@ -1,6 +1,7 @@ package net.pterodactylus.fcp.quelaton; import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.allOf; import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.hasItem; @@ -2145,14 +2146,28 @@ public class DefaultFcpClientTest { @Test public void reloadingPluginWorks() throws InterruptedException, ExecutionException, IOException { Future> pluginInfo = fcpClient.reloadPlugin().plugin(CLASS_NAME).execute(); - connectAndAssert(() -> matchesFcpMessage( + connectAndAssert(() -> matchReloadPluginMessage()); + replyWithPluginInfo(); + verifyPluginInfo(pluginInfo); + } + + @Test + public void reloadingPluginWithMaxWaitTimeWorks() + throws InterruptedException, ExecutionException, IOException { + Future> pluginInfo = + fcpClient.reloadPlugin().waitFor(1234).plugin(CLASS_NAME).execute(); + connectAndAssert(() -> allOf(matchReloadPluginMessage(), hasItem("MaxWaitTime=1234"))); + replyWithPluginInfo(); + verifyPluginInfo(pluginInfo); + } + + private Matcher> matchReloadPluginMessage() { + return matchesFcpMessage( "ReloadPlugin", "Identifier=" + identifier, "PluginName=" + CLASS_NAME, "EndMessage" - )); - replyWithPluginInfo(); - verifyPluginInfo(pluginInfo); + ); } }