- java.lang.Object
-
- io.helidon.config.testing.OptionalMatcher
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> org.hamcrest.Matcher<Optional<T>>
empty()
A matcher for anOptional
that checks it is empty.static <T> org.hamcrest.Matcher<Optional<T>>
present()
A matcher for anOptional
that checks it is present.static <T> org.hamcrest.Matcher<Optional<T>>
value(org.hamcrest.Matcher<T> matcher)
A matcher for anOptional
that checks it is present, and that the value matches the provided matcher.
-
-
-
Method Detail
-
value
public static <T> org.hamcrest.Matcher<Optional<T>> value(org.hamcrest.Matcher<T> matcher)
A matcher for anOptional
that checks it is present, and that the value matches the provided matcher.Usage example:
assertThat(myOptional, value(is("expected")));
- Type Parameters:
T
- type of the value- Parameters:
matcher
- matcher to validate the content of the optional- Returns:
- matcher validating the
Optional
is present and matches the provided matcher
-
empty
public static <T> org.hamcrest.Matcher<Optional<T>> empty()
- Type Parameters:
T
- type of the optional- Returns:
- matcher validating the
Optional
is empty
-
-