Add method to remove cached plugin after removing plugin
[jFCPlib.git] / src / test / java / net / pterodactylus / fcp / quelaton / DefaultFcpClientTest.java
index fafee42..ed8a02e 100644 (file)
@@ -2202,6 +2202,24 @@ public class DefaultFcpClientTest {
                                assertThat(pluginRemoved.get(), is(true));
                        }
 
+                       @Test
+                       public void removingPluginWithMaxWaitTimeWorks()
+                       throws InterruptedException, ExecutionException, IOException {
+                               Future<Boolean> pluginRemoved = fcpClient.removePlugin().waitFor(1234).plugin(CLASS_NAME).execute();
+                               connectAndAssert(() -> allOf(matchPluginRemovedMessage(), hasItem("MaxWaitTime=1234")));
+                               replyWithPluginRemoved();
+                               assertThat(pluginRemoved.get(), is(true));
+                       }
+
+                       @Test
+                       public void removingPluginWithPurgeWorks()
+                       throws InterruptedException, ExecutionException, IOException {
+                               Future<Boolean> pluginRemoved = fcpClient.removePlugin().purge().plugin(CLASS_NAME).execute();
+                               connectAndAssert(() -> allOf(matchPluginRemovedMessage(), hasItem("Purge=true")));
+                               replyWithPluginRemoved();
+                               assertThat(pluginRemoved.get(), is(true));
+                       }
+
                        private void replyWithPluginRemoved() throws IOException {
                                fcpServer.writeLine(
                                        "PluginRemoved",