More cleanup
This commit is contained in:
parent
c2141ce38b
commit
eba88b2773
17 changed files with 35 additions and 27 deletions
|
@ -58,7 +58,7 @@ artifacts {
|
|||
test {
|
||||
testLogging {
|
||||
events "failed", "skipped"
|
||||
showStandardStreams true
|
||||
showStandardStreams = true
|
||||
showExceptions true
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ public class CommandDispatcher<T> {
|
|||
context.getCommand().run(context);
|
||||
}
|
||||
|
||||
protected CommandContext<T> parseNodes(CommandNode node, String command, CommandContextBuilder<T> contextBuilder) throws CommandException {
|
||||
private CommandContext<T> parseNodes(CommandNode node, String command, CommandContextBuilder<T> contextBuilder) throws CommandException {
|
||||
CommandException exception = null;
|
||||
|
||||
for (CommandNode child : node.getChildren()) {
|
||||
|
|
|
@ -17,7 +17,7 @@ public class IntegerArgumentType implements CommandArgumentType<Integer> {
|
|||
private final int minimum;
|
||||
private final int maximum;
|
||||
|
||||
protected IntegerArgumentType(int minimum, int maximum) {
|
||||
private IntegerArgumentType(int minimum, int maximum) {
|
||||
this.minimum = minimum;
|
||||
this.maximum = maximum;
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ public abstract class ArgumentBuilder<T extends ArgumentBuilder<?>> {
|
|||
return getThis();
|
||||
}
|
||||
|
||||
public Command getCommand() {
|
||||
protected Command getCommand() {
|
||||
return command;
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ public class LiteralArgumentBuilder extends ArgumentBuilder<LiteralArgumentBuild
|
|||
return this;
|
||||
}
|
||||
|
||||
public String getLiteral() {
|
||||
private String getLiteral() {
|
||||
return literal;
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ public class RequiredArgumentBuilder<T> extends ArgumentBuilder<RequiredArgument
|
|||
private final String name;
|
||||
private final CommandArgumentType<T> type;
|
||||
|
||||
protected RequiredArgumentBuilder(String name, CommandArgumentType<T> type) {
|
||||
private RequiredArgumentBuilder(String name, CommandArgumentType<T> type) {
|
||||
this.name = name;
|
||||
this.type = type;
|
||||
}
|
||||
|
@ -22,11 +22,11 @@ public class RequiredArgumentBuilder<T> extends ArgumentBuilder<RequiredArgument
|
|||
return this;
|
||||
}
|
||||
|
||||
public CommandArgumentType<T> getType() {
|
||||
private CommandArgumentType<T> getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
private String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,9 +24,11 @@ import static org.mockito.Mockito.*;
|
|||
|
||||
@RunWith(MockitoJUnitRunner.class)
|
||||
public class CommandDispatcherTest {
|
||||
CommandDispatcher<Object> subject;
|
||||
@Mock Command command;
|
||||
@Mock Object source;
|
||||
private CommandDispatcher<Object> subject;
|
||||
@Mock
|
||||
private Command command;
|
||||
@Mock
|
||||
private Object source;
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
|
|
|
@ -20,9 +20,11 @@ import static org.junit.Assert.fail;
|
|||
|
||||
@RunWith(MockitoJUnitRunner.class)
|
||||
public class CommandDispatcherUsagesTest {
|
||||
CommandDispatcher<Object> subject;
|
||||
@Mock Object source;
|
||||
@Mock Command command;
|
||||
private CommandDispatcher<Object> subject;
|
||||
@Mock
|
||||
private Object source;
|
||||
@Mock
|
||||
private Command command;
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
|
|
|
@ -19,7 +19,7 @@ import static org.junit.Assert.assertThat;
|
|||
import static org.junit.Assert.fail;
|
||||
|
||||
public class IntegerArgumentTypeTest {
|
||||
IntegerArgumentType type;
|
||||
private IntegerArgumentType type;
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
|
|
|
@ -11,7 +11,7 @@ import static org.hamcrest.Matchers.hasSize;
|
|||
import static org.junit.Assert.assertThat;
|
||||
|
||||
public class ArgumentBuilderTest {
|
||||
TestableArgumentBuilder builder;
|
||||
private TestableArgumentBuilder builder;
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
|
|
|
@ -13,8 +13,9 @@ import static org.hamcrest.Matchers.is;
|
|||
import static org.junit.Assert.assertThat;
|
||||
|
||||
public class LiteralArgumentBuilderTest {
|
||||
LiteralArgumentBuilder builder;
|
||||
private LiteralArgumentBuilder builder;
|
||||
@Mock
|
||||
private
|
||||
Command command;
|
||||
|
||||
@Before
|
||||
|
|
|
@ -14,9 +14,11 @@ import static org.hamcrest.Matchers.is;
|
|||
import static org.junit.Assert.assertThat;
|
||||
|
||||
public class RequiredArgumentBuilderTest {
|
||||
@Mock CommandArgumentType<Integer> type;
|
||||
RequiredArgumentBuilder<Integer> builder;
|
||||
@Mock
|
||||
private CommandArgumentType<Integer> type;
|
||||
private RequiredArgumentBuilder<Integer> builder;
|
||||
@Mock
|
||||
private
|
||||
Command command;
|
||||
|
||||
@Before
|
||||
|
|
|
@ -18,8 +18,9 @@ import static org.mockito.Mockito.mock;
|
|||
|
||||
@RunWith(MockitoJUnitRunner.class)
|
||||
public class CommandContextTest {
|
||||
CommandContextBuilder<Object> builder;
|
||||
@Mock Object source;
|
||||
private CommandContextBuilder<Object> builder;
|
||||
@Mock
|
||||
private Object source;
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
|
|
|
@ -12,7 +12,7 @@ import static org.junit.Assert.assertThat;
|
|||
|
||||
@SuppressWarnings("ThrowableResultOfMethodCallIgnored")
|
||||
public class ParameterizedCommandExceptionTypeTest {
|
||||
ParameterizedCommandExceptionType type;
|
||||
private ParameterizedCommandExceptionType type;
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
|
|
|
@ -20,8 +20,8 @@ import static org.junit.Assert.fail;
|
|||
import static org.mockito.Mockito.mock;
|
||||
|
||||
public class ArgumentCommandNodeTest extends AbstractCommandNodeTest {
|
||||
ArgumentCommandNode<Integer> node;
|
||||
CommandContextBuilder<Object> contextBuilder;
|
||||
private ArgumentCommandNode<Integer> node;
|
||||
private CommandContextBuilder<Object> contextBuilder;
|
||||
|
||||
@Override
|
||||
protected CommandNode getCommandNode() {
|
||||
|
|
|
@ -18,8 +18,8 @@ import static org.junit.Assert.fail;
|
|||
import static org.mockito.Mockito.mock;
|
||||
|
||||
public class LiteralCommandNodeTest extends AbstractCommandNodeTest {
|
||||
LiteralCommandNode node;
|
||||
CommandContextBuilder<Object> contextBuilder;
|
||||
private LiteralCommandNode node;
|
||||
private CommandContextBuilder<Object> contextBuilder;
|
||||
|
||||
@Override
|
||||
protected CommandNode getCommandNode() {
|
||||
|
|
|
@ -10,7 +10,7 @@ import static org.hamcrest.Matchers.is;
|
|||
import static org.junit.Assert.assertThat;
|
||||
|
||||
public class RootCommandNodeTest extends AbstractCommandNodeTest {
|
||||
RootCommandNode node;
|
||||
private RootCommandNode node;
|
||||
|
||||
@Override
|
||||
protected CommandNode getCommandNode() {
|
||||
|
|
Loading…
Reference in a new issue