Class Wait

java.lang.Object
org.faktorips.testsupport.Wait

public class Wait extends Object
Utility class to wait in increasing intervals up to a set maximum duration for some condition to be true. Throws an AssertionError if the condition is still false after the time has elapsed.
  • Method Details

    • atMost

      public static Wait atMost(Duration duration)
      Creates a new Wait with the given Duration
    • until

      public void until(BooleanSupplier check, String failureMessage)
      Evaluates the given check repeatedly until the wait time has elapsed. If the condition is not met afterwards, an AssertionError with the given message is thrown to fail a JUnit test.
      Throws:
      AssertionError - if the condition is still false after the time has elapsed.