|
|
@ -28,8 +28,8 @@ public class ConditionUtilTest {
|
|
|
|
public void assertCondition() {
|
|
|
|
public void assertCondition() {
|
|
|
|
// init consumer
|
|
|
|
// init consumer
|
|
|
|
AtomicBoolean checkValue = new AtomicBoolean(false);
|
|
|
|
AtomicBoolean checkValue = new AtomicBoolean(false);
|
|
|
|
NoArgsConsumer trueConsumer = () -> checkValue.set(true);
|
|
|
|
NoArgsConsumer trueConsumer = () -> checkValue.set(true);
|
|
|
|
NoArgsConsumer falseConsumer = () -> checkValue.set(false);
|
|
|
|
NoArgsConsumer falseConsumer = () -> checkValue.set(false);
|
|
|
|
// test trueConsumer run
|
|
|
|
// test trueConsumer run
|
|
|
|
ConditionUtil.condition(true, trueConsumer, falseConsumer);
|
|
|
|
ConditionUtil.condition(true, trueConsumer, falseConsumer);
|
|
|
|
Assert.isTrue(checkValue.get());
|
|
|
|
Assert.isTrue(checkValue.get());
|
|
|
|