I'm trying to use Hamcrest, but constantly run into the following:
Hamcrest matchers are shortcircuited, so for eg if I write:
Assert.assertThat(list, everyItem(not(isIn(shouldNotBeInList))));
Just the first faulty element of shouldNotBeInList is reported. I expect tests to tell me as much, as possible.
Could I write assertions in hamcrest, that they report nicely, so that all mismatches are reported, or should I create my own matchers or use another library?
Example output for
List<String> list = Arrays.asList("a", "b", "c");
List<String> shouldNotBeInList = Arrays.asList("c", "e", "a");
Notice no error message for c
Expected: every item is not one of {"c", "e", "a"}
but: an item was "a"