@@ -0,0 +1,2166 @@
+package com.publicuhc.pluginframework.routing;%0A%0Aimport org.bukkit.command.Command;%0Aimport org.bukkit.command.CommandSender;%0Aimport org.bukkit.craftbukkit.libs.joptsimple.OptionParser;%0Aimport org.bukkit.craftbukkit.libs.joptsimple.OptionSet;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.powermock.modules.junit4.PowerMockRunner;%0A%0Aimport java.lang.reflect.InvocationTargetException;%0Aimport java.lang.reflect.Method;%0A%0Aimport static org.mockito.Matchers.any;%0Aimport static org.mockito.Matchers.same;%0Aimport static org.mockito.Mockito.times;%0Aimport static org.mockito.Mockito.verify;%0Aimport static org.powermock.api.mockito.PowerMockito.mock;%0Aimport static org.powermock.api.mockito.PowerMockito.spy;%0A%0A@RunWith(PowerMockRunner.class)%0Apublic class DefaultCommandRouteTest%0A%7B%0A    private DefaultCommandRoute route;%0A    private MethodProxy proxy;%0A    private OptionParser parser;%0A    private TestClass testObject;%0A%0A    @Before%0A    public void onStartup() throws NoSuchMethodException%0A    %7B%0A        testObject = mock(TestClass.class);%0A        Method method = TestClass.class.getMethod(%22testMethod%22, Command.class, CommandSender.class, OptionSet.class);%0A        proxy = spy(new DefaultMethodProxy(testObject, method));%0A        parser = mock(OptionParser.class);%0A        route = new DefaultCommandRoute(%22test%22, proxy, parser);%0A    %7D%0A%0A    @Test%0A    public void testValidInvocation() throws InvocationTargetException, IllegalAccessException%0A    %7B%0A        Command command = mock(Command.class);%0A        CommandSender sender = mock(CommandSender.class);%0A        String%5B%5D args = new String%5B%5D%7B%221%22, %222%22%7D;%0A%0A        route.run(command, sender, args);%0A%0A        verify(parser, times(1)).parse(args);%0A        verify(proxy, times(1)).invoke(same(command), same(sender), any(OptionSet.class));%0A        verify(testObject, times(1)).testMethod(same(command), same(sender), any(OptionSet.class));%0A    %7D%0A%0A    private class TestClass%0A    %7B%0A        public static final String TEST_STRING = %22TEST STRING%22;%0A        public String testMethod(Command command, CommandSender sender, OptionSet set)%0A        %7B%0A            return TEST_STRING;%0A        %7D%0A    %7D%0A%7D%0A

test for commandroute