diff --git a/gclc-test/src/main/java/net/bigeon/gclc/test/InputContract.java b/gclc-test/src/main/java/net/bigeon/gclc/test/InputContract.java index 5f0429f..ce977bc 100644 --- a/gclc-test/src/main/java/net/bigeon/gclc/test/InputContract.java +++ b/gclc-test/src/main/java/net/bigeon/gclc/test/InputContract.java @@ -14,7 +14,6 @@ import java.util.function.Supplier; import net.bigeon.gclc.manager.ConsoleInput; import net.bigeon.test.junitmt.FunctionalTestRunnable; import net.bigeon.test.junitmt.ThreadTest; -import net.bigeon.test.junitmt.api.TestFunction; /** @author Emmanuel Bigeon */ public final class InputContract { @@ -38,24 +37,17 @@ public final class InputContract { // Test interruption contract final ConsoleInput input2 = inputs.get(); final FunctionalTestRunnable prompting = new FunctionalTestRunnable( - new TestFunction() { - - @Override - public void apply() throws Exception { - try { - input2.prompt(); - fail("Interrupted prompt should throw INterruptedIOException"); - } catch (final InterruptedIOException e) { - // ok - } + () -> { + try { + input2.prompt(); + fail("Interrupted prompt should throw INterruptedIOException"); + } catch (final InterruptedIOException e) { + // ok } }); final Thread th = new Thread(prompting); th.start(); -// while (!input2.isPrompting()) { th.join(200); -// -// } input2.interruptPrompt(); ThreadTest.assertRuns(th, prompting); }