All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.leakyabstractions.result.assertj.package-info Maven / Gradle / Ivy

There is a newer version: 1.0.0.0
Show newest version
/**
 * 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: *

    *
  1. Statically import {@code com.leakyabstractions.result.assertj.ResultAssertions.assertThat}. *
  2. Pass the result under test as the sole {@code assertThat} parameter. *
  3. 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;




© 2015 - 2024 Weber Informatics LLC | Privacy Policy