use of org.terasology.logic.console.commandSystem.MethodCommand in project Terasology by MovingBlocks.
the class ComponentSystemManagerTest method shouldRegisterCommandWithoutSenderAnnotation.
@Test
public void shouldRegisterCommandWithoutSenderAnnotation() {
// see https://github.com/MovingBlocks/Terasology/issues/2679
systemUnderTest.register(new SystemWithCommandMissingSenderAnnotation());
systemUnderTest.initialise();
ArgumentCaptor<MethodCommand> methodCommandArgumentCaptor = ArgumentCaptor.forClass(MethodCommand.class);
verify(console).registerCommand(methodCommandArgumentCaptor.capture());
MethodCommand command = methodCommandArgumentCaptor.getValue();
assertThat(command.getName().toString(), is("commandWithoutSenderAnnotation"));
}
use of org.terasology.logic.console.commandSystem.MethodCommand in project Terasology by MovingBlocks.
the class ComponentSystemManagerTest method shouldRegisterCommand.
@Test
public void shouldRegisterCommand() {
systemUnderTest.register(new SystemWithValidCommand());
systemUnderTest.initialise();
ArgumentCaptor<MethodCommand> methodCommandArgumentCaptor = ArgumentCaptor.forClass(MethodCommand.class);
verify(console).registerCommand(methodCommandArgumentCaptor.capture());
MethodCommand command = methodCommandArgumentCaptor.getValue();
assertThat(command.getName().toString(), is("validCommandName"));
}
Aggregations