Updated tests to use Integer return type
This commit is contained in:
parent
0515ff8b28
commit
24316271df
7 changed files with 12 additions and 12 deletions
src/test/java/com/mojang/brigadier
|
@ -36,7 +36,7 @@ import static org.mockito.Mockito.when;
|
|||
public class CommandDispatcherTest {
|
||||
private CommandDispatcher<Object> subject;
|
||||
@Mock
|
||||
private Command<Object> command;
|
||||
private Command<Object, Integer> command;
|
||||
@Mock
|
||||
private Object source;
|
||||
|
||||
|
@ -167,7 +167,7 @@ public class CommandDispatcherTest {
|
|||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
public void testExecuteSubcommand() throws Exception {
|
||||
final Command<Object> subCommand = mock(Command.class);
|
||||
final Command<Object, Integer> subCommand = mock(Command.class);
|
||||
when(subCommand.run(any())).thenReturn(100);
|
||||
|
||||
subject.register(literal("foo").then(
|
||||
|
@ -205,7 +205,7 @@ public class CommandDispatcherTest {
|
|||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
public void testExecuteAmbiguiousParentSubcommand() throws Exception {
|
||||
final Command<Object> subCommand = mock(Command.class);
|
||||
final Command<Object, Integer> subCommand = mock(Command.class);
|
||||
when(subCommand.run(any())).thenReturn(100);
|
||||
|
||||
subject.register(
|
||||
|
@ -231,7 +231,7 @@ public class CommandDispatcherTest {
|
|||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
public void testExecuteAmbiguiousParentSubcommandViaRedirect() throws Exception {
|
||||
final Command<Object> subCommand = mock(Command.class);
|
||||
final Command<Object, Integer> subCommand = mock(Command.class);
|
||||
when(subCommand.run(any())).thenReturn(100);
|
||||
|
||||
final LiteralCommandNode<Object> real = subject.register(
|
||||
|
@ -343,7 +343,7 @@ public class CommandDispatcherTest {
|
|||
|
||||
@Test
|
||||
public void testExecute_invalidOther() throws Exception {
|
||||
final Command<Object> wrongCommand = mock(Command.class);
|
||||
final Command<Object, Integer> wrongCommand = mock(Command.class);
|
||||
subject.register(literal("w").executes(wrongCommand));
|
||||
subject.register(literal("world").executes(command));
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ public class CommandDispatcherUsagesTest {
|
|||
@Mock
|
||||
private Object source;
|
||||
@Mock
|
||||
private Command<Object> command;
|
||||
private Command<Object, Integer> command;
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
|
|
|
@ -19,7 +19,7 @@ public class LiteralArgumentBuilderTest {
|
|||
private LiteralArgumentBuilder<Object> builder;
|
||||
@Mock
|
||||
private
|
||||
Command<Object> command;
|
||||
Command<Object, Integer> command;
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
|
|
|
@ -25,7 +25,7 @@ public class RequiredArgumentBuilderTest {
|
|||
private RequiredArgumentBuilder<Object, Integer> builder;
|
||||
@Mock
|
||||
private
|
||||
Command<Object> command;
|
||||
Command<Object, Integer> command;
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
|
|
|
@ -65,8 +65,8 @@ public class CommandContextTest {
|
|||
@Test
|
||||
public void testEquals() throws Exception {
|
||||
final Object otherSource = new Object();
|
||||
final Command<Object> command = mock(Command.class);
|
||||
final Command<Object> otherCommand = mock(Command.class);
|
||||
final Command<Object, Integer> command = mock(Command.class);
|
||||
final Command<Object, Integer> otherCommand = mock(Command.class);
|
||||
final CommandNode<Object> rootNode = mock(CommandNode.class);
|
||||
final CommandNode<Object> otherRootNode = mock(CommandNode.class);
|
||||
final CommandNode<Object> node = mock(CommandNode.class);
|
||||
|
|
|
@ -57,7 +57,7 @@ public class ArgumentCommandNodeTest extends AbstractCommandNodeTest {
|
|||
|
||||
@Test
|
||||
public void testEquals() throws Exception {
|
||||
@SuppressWarnings("unchecked") final Command<Object> command = (Command<Object>) mock(Command.class);
|
||||
@SuppressWarnings("unchecked") final Command<Object, Integer> command = (Command<Object, Integer>) mock(Command.class);
|
||||
|
||||
new EqualsTester()
|
||||
.addEqualityGroup(
|
||||
|
|
|
@ -100,7 +100,7 @@ public class LiteralCommandNodeTest extends AbstractCommandNodeTest {
|
|||
|
||||
@Test
|
||||
public void testEquals() throws Exception {
|
||||
@SuppressWarnings("unchecked") final Command<Object> command = mock(Command.class);
|
||||
@SuppressWarnings("unchecked") final Command<Object, Integer> command = mock(Command.class);
|
||||
|
||||
new EqualsTester()
|
||||
.addEqualityGroup(
|
||||
|
|
Loading…
Reference in a new issue