[rhq.next] Using assert-j in tests

Thomas Segismont tsegismo at redhat.com
Tue Dec 2 09:09:48 UTC 2014


Hi,

Last week I submitted a PR "Rest test: don't rebuild rest war over and 
over again when Arquillian @Deployment method is executed" [1]

As part of the changes, I added a new test dependency to assertj [2]

Before the PR can be merged, do you all agree to use this? It's only a 
test dependency.

Here's what I like:

* write assertThat(testedObject) and then use code completion to find 
the method you need

* nice fluent API

```
WebArchive[] webArchives = ...;
assertThat(webArchives).isNotNull().isNotEmpty().hasSize(1);
```

This reads much better IMO that the equivalent with base 
assertNull/assertFalse/assertEquals


There's a good descriptions of features on the project site [2].

Regards,
Thomas


[1] https://github.com/rhq-project/rhq-metrics/pull/72
[2] 
http://joel-costigliola.github.io/assertj/assertj-core-features-highlight.html


More information about the rhq-devel mailing list