ConditionalTest: tidy up
This commit is contained in:
parent
fd947df855
commit
a78f6de32b
1 changed files with 19 additions and 14 deletions
|
@ -218,19 +218,6 @@ public class ConditionalTest {
|
||||||
assertThatNoResponseRuns();
|
assertThatNoResponseRuns();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void whenOr(final boolean firstClause, final boolean secondClause) {
|
|
||||||
Condition.where(firstClause)
|
|
||||||
.or(secondClause)
|
|
||||||
.then(thenResponse)
|
|
||||||
.otherwise(otherwiseResponse);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void when(final boolean clause) {
|
|
||||||
Condition.where(clause)
|
|
||||||
.then(thenResponse)
|
|
||||||
.otherwise(otherwiseResponse);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void assertThatBothResponsesRun() {
|
private void assertThatBothResponsesRun() {
|
||||||
assertThatTheThenResponseRan();
|
assertThatTheThenResponseRan();
|
||||||
assertThatTheOtherwiseResponseRan();
|
assertThatTheOtherwiseResponseRan();
|
||||||
|
@ -271,11 +258,29 @@ public class ConditionalTest {
|
||||||
assertThatTheOtherwiseResponseDidNotRun();
|
assertThatTheOtherwiseResponseDidNotRun();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void when(final boolean firstClause, final boolean secondClause) {
|
private void when(final boolean clause) {
|
||||||
|
Condition.where(clause)
|
||||||
|
.then(thenResponse)
|
||||||
|
.otherwise(otherwiseResponse);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void when(
|
||||||
|
final boolean firstClause,
|
||||||
|
final boolean secondClause
|
||||||
|
) {
|
||||||
Condition.where(firstClause)
|
Condition.where(firstClause)
|
||||||
.and(secondClause)
|
.and(secondClause)
|
||||||
.then(thenResponse)
|
.then(thenResponse)
|
||||||
.otherwise(otherwiseResponse);
|
.otherwise(otherwiseResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void whenOr(
|
||||||
|
final boolean firstClause,
|
||||||
|
final boolean secondClause
|
||||||
|
) {
|
||||||
|
Condition.where(firstClause)
|
||||||
|
.or(secondClause)
|
||||||
|
.then(thenResponse)
|
||||||
|
.otherwise(otherwiseResponse);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue