Releases: sviperll/result4j
Releases · sviperll/result4j
result4j-1.2.0
Maven Central: com.github.sviperll:result4j:1.2.0
What's Changed
- Rename throwError to orOnErrorThrow by @marcindabrowski in #6
- Provide Assertj helpers by @marcindabrowski and @sviperll in (#9, #10, #11. #12)
Full Changelog: result4j-1.1.4...result4j-1.2.0
Assertj helpers
Result4j now provides integration with the AssertJ testing-framework. To use it you should use a separate assertj-result4j
artifact (See Maven Central Page):
<dependency>
<groupId>com.github.sviperll</groupId>
<artifactId>assertj-result4j</artifactId>
<version>1.2.0</version>
</dependency>
The library allows you to write easy to read assertion in the style of AsserJ.
Assertion of the result of the successful operation:
assertThat(result)
.isSuccess()
.hasSuccessValueThat()
.asInstanceOf(list(Integer.class))
.containsExactlyInAnyOrderElementsOf(List.of(456, 234, 123));
Assertion of the error:
assertThat(result)
.isError()
.hasErrorThat()
.asInstanceOf(InstanceOfAssertFactories.THROWABLE)
.isExactlyInstanceOf(RuntimeException.class)
.cause()
.isExactlyInstanceOf(NumberFormatException.class)
.hasMessage("For input string: \"xvxv\"");
See API documentation for more details.
result4j-1.1.3
Maven Central: com.github.sviperll:result4j:1.1.3
What's Changed
- Add peekError and peekSuccess methods by @marcindabrowski in #3
- GitHub workflow for Continuous Integration Checks by @marcindabrowski in #4 and #5
Full Changelog: result4j-1.0...result4j-1.1.3