Within tests, we have at least 3 kinds of libraries used for assertions:
org.hamcrest.Matchers.*org.junit.jupiter.api.Assertions.*org.assertj.core.api.Assertions.*We should standardize them and prepare a doc on how to write test assertions. We decided to use AssertJ (https://joel-costigliola.github.io/assertj/) to replace JUnit 5 and Hamcrest assertions. See also https://joel-costigliola.github.io/assertj/assertj-core-converting-junit5-assertions-to-assertj.html for examples.
Note: During the course of standardizing the tests, @mkuligowski and @fuss86 noticed that dropping Hamcrest in the strongbox-web-core will introduce a lot of complications due to spring-projects/spring-framework#21178. We decided that until the mentioned issue is fixed, the strongbox-web-core will be the only module in the project which will continue to use hamcrest.
The following tasks will need to be carried out in both the strongbox and strongbox-npm-metadata projects:
<groupId>org.hamcrest</groupId> dependency from pom.xml files~<groupId>org.hamcrest</groupId> from dependency treeorg.hamcrest.*Matchers by their AssertJ counterparts (except for strongbox-web-core)org.junit.jupiter.api.Assertions by their AssertJ counterparts This task may be split into sub-tasks to perform the standardization per module for example.
I can take this
@tizzymac go for it :)
Can I take this?
It's been two weeks when task was taken
Yes, please, @mslowiak !
There is an issue which prevents us from fully switching to AssertJ (spring-projects/spring-framework#21178). We have decided to leave it for now in the strongbox-web-core module to prevent introducing additional complexity into the test cases. Once spring-projects/spring-framework#21178 is fixed we can make the switch there as well.
// cc @fuss86
Most helpful comment
There is an issue which prevents us from fully switching to AssertJ (spring-projects/spring-framework#21178). We have decided to leave it for now in the
strongbox-web-coremodule to prevent introducing additional complexity into the test cases. Once spring-projects/spring-framework#21178 is fixed we can make the switch there as well.// cc @fuss86