Package io.helidon.common.testing.junit5
Class MatcherWithRetry
java.lang.Object
io.helidon.common.testing.junit5.MatcherWithRetry
Hamcrest matcher capable of configured retries before failing the assertion, plus more generic retry processing.
- 
Method SummaryModifier and TypeMethodDescriptionstatic <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 <T> TassertThatWithRetry(String reason, Supplier<T> actualSupplier, org.hamcrest.Matcher<? super T> matcher, int retryCount, int retryDelayMs) 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 <T> TassertThatWithRetry(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.
- 
Method Details- 
assertThatWithRetrypublic static <T> T assertThatWithRetry(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.- 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
 
- 
assertThatWithRetrypublic static <T> T assertThatWithRetry(String reason, Supplier<T> actualSupplier, org.hamcrest.Matcher<? super T> matcher, int retryCount, int retryDelayMs) 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
- retryCount- number of times to retry the supplier while it does not give an answer satisfying the matcher
- retryDelayMs- delay in milliseconds between retries
- Returns:
- the supplied value
 
- 
assertThatWithRetrypublic static <T> T assertThatWithRetry(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.- Type Parameters:
- T- type of the supplied value
- Parameters:
- actualSupplier-- Supplierthat furnishes the value to submit to the matcher
- matcher- Hamcrest matcher which evaluates the supplied value
- Returns:
- the supplied value
 
 
-