More cleanup

This commit is contained in:
Nathan Adams 2017-06-21 14:36:17 +02:00
parent c2141ce38b
commit eba88b2773
17 changed files with 35 additions and 27 deletions

View file

@ -58,7 +58,7 @@ artifacts {
test {
testLogging {
events "failed", "skipped"
showStandardStreams true
showStandardStreams = true
showExceptions true
}
}

View file

@ -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()) {

View file

@ -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;
}

View file

@ -26,7 +26,7 @@ public abstract class ArgumentBuilder<T extends ArgumentBuilder<?>> {
return getThis();
}
public Command getCommand() {
protected Command getCommand() {
return command;
}

View file

@ -19,7 +19,7 @@ public class LiteralArgumentBuilder extends ArgumentBuilder<LiteralArgumentBuild
return this;
}
public String getLiteral() {
private String getLiteral() {
return literal;
}

View file

@ -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;
}

View file

@ -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 {

View file

@ -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 {

View file

@ -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 {

View file

@ -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 {

View file

@ -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

View file

@ -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

View file

@ -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 {

View file

@ -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 {

View file

@ -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() {

View file

@ -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() {

View file

@ -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() {