Improve command decorator names (#1945)

This commit is contained in:
Oblarg
2019-10-19 11:13:33 -04:00
committed by Peter Johnson
parent a38f183a98
commit 53816155ba
18 changed files with 47 additions and 46 deletions

View File

@@ -36,12 +36,12 @@ class CommandDecoratorTest extends CommandTestBase {
}
@Test
void interruptOnTest() {
void withInterruptTest() {
CommandScheduler scheduler = new CommandScheduler();
ConditionHolder condition = new ConditionHolder();
Command command = new WaitCommand(10).interruptOn(condition::getCondition);
Command command = new WaitCommand(10).withInterrupt(condition::getCondition);
scheduler.schedule(command);
scheduler.run();
@@ -66,7 +66,7 @@ class CommandDecoratorTest extends CommandTestBase {
}
@Test
void whenFinishedTest() {
void andThenLambdaTest() {
CommandScheduler scheduler = new CommandScheduler();
ConditionHolder condition = new ConditionHolder();
@@ -74,7 +74,7 @@ class CommandDecoratorTest extends CommandTestBase {
Command command = new InstantCommand();
scheduler.schedule(command.whenFinished(() -> condition.setCondition(true)));
scheduler.schedule(command.andThen(() -> condition.setCondition(true)));
assertFalse(condition.getCondition());

View File

@@ -47,7 +47,7 @@ class CommandGroupErrorTest extends CommandTestBase {
void redecoratedCommandErrorTest() {
Command command = new InstantCommand();
assertDoesNotThrow(() -> command.withTimeout(10).interruptOn(() -> false));
assertDoesNotThrow(() -> command.withTimeout(10).withInterrupt(() -> false));
assertThrows(IllegalArgumentException.class, () -> command.withTimeout(10));
CommandGroupBase.clearGroupedCommand(command);
assertDoesNotThrow(() -> command.withTimeout(10));