Skip to content

Releases: sviperll/result4j

result4j-1.2.0

09 Dec 12:07
Compare
Choose a tag to compare

Maven Central: com.github.sviperll:result4j:1.2.0

What's Changed

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

09 Dec 11:40
Compare
Choose a tag to compare

Maven Central: com.github.sviperll:result4j:1.1.3

What's Changed

Full Changelog: result4j-1.0...result4j-1.1.3