// Callable<Boolean> mismatch tests
@SuppressWarnings("Convert2Lambda")
@Test(timeout = 2000)
public void expectedMismatchMessageForCallableConditionsWithoutAliasWhenNotUsingLambda() {
final CountDown countDown = new CountDown(10);
final AtomicReference<String> lastMatchMessage = new AtomicReference<>();
try {
with()
.conditionEvaluationListener(condition -> lastMatchMessage.set(condition.getDescription()))
.await().atMost(150, MILLISECONDS)
.until(new Callable<Boolean>() {
@Override
public Boolean call() throws Exception {
return countDown.call() == -1;
}
});
fail("Should fail");
} catch (Exception e) {
assertThat(lastMatchMessage.get(), allOf(startsWith("Callable condition defined in"), containsString(testName.getMethodName()), endsWith("returned false")));