com.leakyabstractions.result.assertj.package-info Maven / Gradle / Ivy
/**
* Provides assertions for {@link com.leakyabstractions.result.api.Result} type.
* AssertJ assertions for {@code Result}
*
* If you think some assertion is missing, please create an
* issue or even better contribute!
*
* Result Library for Java is hosted on GitHub.
*
* To quickly start using Result assertions, follow these steps:
*
* - Statically import {@code com.leakyabstractions.result.assertj.ResultAssertions.assertThat}.
*
- Pass the result under test as the sole {@code assertThat} parameter.
*
- Use code completion to discover assertions.
*
* Statically import {@code assertThat}
*
*
*
* import static com.leakyabstractions.result.assertj.ResultAssertions.assertThat;
*
*
*
* Pass the result under test as the sole {@code assertThat} parameter
*
*
*
* assertThat(result)
*
*
*
* Use code completion to discover assertions
*
* Use your preferred IDE code completion after
* {@link ResultAssertions#assertThat(com.leakyabstractions.result.api.Result) assertThat} to discover and call
* assertions.
*
*
*
* &Test
* public void should_pass() {
* // Given
* final int number = someMethodReturningInt();
* // When
* final Result<String, Integer> result = someMethodReturningResult(number);
* // Then
* assertThat(number).isZero();
* assertThat(result).hasSuccess("OK");
* }
*
*
*
* @author Guillermo Calvo
* @see ResultAssertions
* @see com.leakyabstractions.result.api.Result
*/
package com.leakyabstractions.result.assertj;