Class DmxFunAssertions
java.lang.Object
dmx.fun.assertj.DmxFunAssertions
Entry point for AssertJ custom assertions for all dmx-fun types.
Use static imports for fluent syntax:
import static dmx.fun.assertj.DmxFunAssertions.assertThat;
assertThat(Option.some(42)).isSome().containsValue(42);
assertThat(Result.ok("hello")).isOk().containsValue("hello");
assertThat(Try.success(1)).isSuccess().containsValue(1);
assertThat(Validated.valid("ok")).isValid().containsValue("ok");
-
Method Summary
Modifier and TypeMethodDescriptionstatic <V> OptionAssert<V> assertThat(Option<V> actual) Creates an assertion for anOption.static <V,E> ResultAssert <V, E> assertThat(Result<V, E> actual) Creates an assertion for aResult.static <V> TryAssert<V> assertThat(Try<V> actual) Creates an assertion for aTry.static <A,B> Tuple2Assert <A, B> assertThat(Tuple2<A, B> actual) Creates an assertion for aTuple2.static <A,B, C> Tuple3Assert <A, B, C> assertThat(Tuple3<A, B, C> actual) Creates an assertion for aTuple3.static <A,B, C, D> Tuple4Assert <A, B, C, D> assertThat(Tuple4<A, B, C, D> actual) Creates an assertion for aTuple4.static <E,A> ValidatedAssert <E, A> assertThat(Validated<E, A> actual) Creates an assertion for aValidated.
-
Method Details
-
assertThat
Creates an assertion for anOption.- Type Parameters:
V- the value type- Parameters:
actual- the Option to assert on- Returns:
- a new
OptionAssert
-
assertThat
Creates an assertion for aResult.- Type Parameters:
V- the success value typeE- the error type- Parameters:
actual- the Result to assert on- Returns:
- a new
ResultAssert
-
assertThat
-
assertThat
Creates an assertion for aValidated.- Type Parameters:
E- the error typeA- the value type- Parameters:
actual- the Validated to assert on- Returns:
- a new
ValidatedAssert
-
assertThat
Creates an assertion for aTuple2.- Type Parameters:
A- the first element typeB- the second element type- Parameters:
actual- the Tuple2 to assert on- Returns:
- a new
Tuple2Assert
-
assertThat
Creates an assertion for aTuple3.- Type Parameters:
A- the first element typeB- the second element typeC- the third element type- Parameters:
actual- the Tuple3 to assert on- Returns:
- a new
Tuple3Assert
-
assertThat
Creates an assertion for aTuple4.- Type Parameters:
A- the first element typeB- the second element typeC- the third element typeD- the fourth element type- Parameters:
actual- the Tuple4 to assert on- Returns:
- a new
Tuple4Assert
-