use of org.cactoos.proc.RunnableOf in project cactoos by yegor256.
the class ScalarOfTest method worksWithRunnable.
@Test
void worksWithRunnable() {
final Object obj = new Object();
final Object result = new Object();
final AtomicReference<Object> done = new AtomicReference<>();
new Assertion<>("Must convert Runnable into Scalar", new ScalarOf<>(new RunnableOf(() -> {
done.set(result);
}), obj), new Satisfies<>(scalar -> {
final Object res = scalar.value();
return res.equals(obj) && done.get().equals(result);
})).affirm();
}
Aggregations