Add method to add a command for testing.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 26 Oct 2013 12:54:48 +0000 (14:54 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 28 Feb 2014 21:25:46 +0000 (22:25 +0100)
src/main/java/net/pterodactylus/sone/fcp/FcpInterface.java

index 02d84cc..0b0dcb9 100644 (file)
@@ -39,6 +39,7 @@ import freenet.pluginmanager.PluginReplySender;
 import freenet.support.SimpleFieldSet;
 import freenet.support.api.Bucket;
 
+import com.google.common.annotations.VisibleForTesting;
 /**
  * Implementation of an FCP interface for other clients or plugins to
  * communicate with Sone.
@@ -106,6 +107,11 @@ public class FcpInterface {
        // ACCESSORS
        //
 
+       @VisibleForTesting
+       void addCommand(String name, AbstractSoneCommand command) {
+               commands.put(name, command);
+       }
+
        /**
         * Sets whether the FCP interface should handle requests. If {@code active}
         * is {@code false}, all requests are answered with an error.