Can somebody show me a complete minimal example for fail at end behaviour?
The docs I found says just:
expect.that(actual).isEqualTo(expected); // supplied by @Rule
Use case: I would like to have one test, multiple asserts (assertions on the same object, but I would like to see all assert failures, because the test itself is a long-running process).
Expectis intended to be used as a JUnit@Rule. You'll see in the source code that theAssertionErroris thrown after the test finishes, in the rule'sapply()method. Here's a simplified version of what it does:There's an example usage of
Expectin the unit tests (which isn't to say it shouldn't be better-documented elsewhere). Essentially, just add a line like:Then use
expect.that(foo)....to make assertions aboutfoothat don't cause the test to fail-fast, instead failing once the test is complete.