3 ms·
For the Java version I would seriously consider not using JUnit 4's assertThat and instead rely on AssertJ [1]. Besides AssertJ being easier to use and IMO mor
by agentgt 10y ago
For the Java version I would seriously consider not using JUnit 4's assertThat and instead rely on AssertJ [1].
Besides AssertJ being easier to use and IMO more elegant than Hamcrest, JUnit 5 will be removin `assertThat`.
I contemplated filing a bug/request but its more of a conversation point than an issue.
[1]: http://joel-costigliola.github.io/assertj/ http://joel-costigliola.github.io/assertj/
- coredog64 10y agoAccording to this issue[1], JUnit5 will still allow the use of Hamcrest's 'assertThat' in the next major revision. [1]: https://github.com/junit-team/junit5/issues/147 https://github.com/junit-team/junit5/issues/147
- agentgt 10y agoHow is that possibly if Hamcrest isn't going to be put in? I think you misread that bug report. >Closing this issue since there are no plans to include direct dependencies on third-party assertion libraries within JUnit 5.
- mdolan 10y agoYou are probably missing the point of this exercise.
- agentgt 10y agoI am not. That is exactly why I did not file a bug and instead posted here. The OP shows examples assertions using JUnit 4 and hamcrest assertThat. The OP could use the builtin assert for all I care but I sort of got the gist they were trying to show the canonical approach. This is not to critique but rather to inform.