Added a 'source' for commands that may be passed around in the context

This commit is contained in:
Nathan Adams
2014-09-29 12:18:40 +02:00
parent 6a8d067cf9
commit 2114f086cb
10 changed files with 60 additions and 41 deletions
@@ -15,7 +15,7 @@ import static org.mockito.Mockito.mock;
public class ArgumentCommandNodeTest extends AbstractCommandNodeTest {
ArgumentCommandNode node;
CommandContextBuilder contextBuilder;
CommandContextBuilder<Object> contextBuilder;
@Override
protected CommandNode getCommandNode() {
@@ -25,7 +25,7 @@ public class ArgumentCommandNodeTest extends AbstractCommandNodeTest {
@Before
public void setUp() throws Exception {
node = argument("foo", integer()).build();
contextBuilder = new CommandContextBuilder();
contextBuilder = new CommandContextBuilder<Object>(new Object());
}
@Test
@@ -14,7 +14,7 @@ import static org.mockito.Mockito.mock;
public class LiteralCommandNodeTest extends AbstractCommandNodeTest {
LiteralCommandNode node;
CommandContextBuilder contextBuilder;
CommandContextBuilder<Object> contextBuilder;
@Override
protected CommandNode getCommandNode() {
@@ -24,7 +24,7 @@ public class LiteralCommandNodeTest extends AbstractCommandNodeTest {
@Before
public void setUp() throws Exception {
node = literal("foo").build();
contextBuilder = new CommandContextBuilder();
contextBuilder = new CommandContextBuilder<Object>(new Object());
}
@Test
@@ -24,7 +24,7 @@ public class RootCommandNodeTest extends AbstractCommandNodeTest {
@Test
public void testParse() throws Exception {
assertThat(node.parse("foo bar baz", new CommandContextBuilder()), is("foo bar baz"));
assertThat(node.parse("foo bar baz", new CommandContextBuilder<Object>(new Object())), is("foo bar baz"));
}
@Test(expected = UnsupportedOperationException.class)