- java.lang.Object
- 
- io.helidon.config.testing.MatcherWithRetry
 
- 
 public class MatcherWithRetry extends Object Hamcrest matcher capable of configured retries before failing the assertion, plus more generic retry processing.
- 
- 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> TassertThatWithRetry(String reason, Supplier<T> actualSupplier, org.hamcrest.Matcher<? super T> matcher)Checks the matcher, possibly multiple times after configured delays, invoking the supplier of the matched value each time, until either the matcher passes or the maximum retry expires.static voidretry(Callable<Boolean> work)Retries the specified work until successful or retry limit is exceeded.
 
- 
- 
- 
Method Detail- 
assertThatWithRetrypublic static <T> T assertThatWithRetry(String reason, Supplier<T> actualSupplier, org.hamcrest.Matcher<? super T> matcher) throws InterruptedException Checks the matcher, possibly multiple times after configured delays, invoking the supplier of the matched value each time, until either the matcher passes or the maximum retry expires.- Type Parameters:
- T- type of the supplied value
- Parameters:
- reason- explanation of the assertion
- actualSupplier-- Supplierthat furnishes the value to submit to the matcher
- matcher- Hamcrest matcher which evaluates the supplied value
- Returns:
- the supplied value
- Throws:
- InterruptedException- if the sleep is interrupted
 
 - 
retrypublic static void retry(Callable<Boolean> work) throws Exception Retries the specified work until successful or retry limit is exceeded.- Parameters:
- work- the work to perform; returned boolean indicates if the work was successful
- Throws:
- Exception- exception from the work or from the sleep being interrupted
 
 
- 
 
-