teleivo <teleivo@users.noreply.github.com>
b8cfe58bf282fd24b2906322fb56c0083576e070
b8cfe58bf282fd24b2906322fb56c0083576e070
Assert collections are empty using hamcrest
which in case the collection is not empty gives us
java.lang.AssertionError:
Expected: is an empty collection
but: <[a]>
knowing whats in it might already give you a clue as to what went wrong
14 Jul 2020
teleivo <teleivo@users.noreply.github.com>
f4879ac62b4536e604d6980107ee0dd2c8cc0254
f4879ac62b4536e604d6980107ee0dd2c8cc0254
Use hasSize assertion for collections
So in case the size is not equal to one I do not only get an error
message saying you wanted the expression to be true but it was false.
Instead I want to see the actual size of the collection in this case
14 Jul 2020
teleivo <teleivo@users.noreply.github.com>
e9005fd8764e8e6dfa2e66ecd11bf786f83ae4a5
e9005fd8764e8e6dfa2e66ecd11bf786f83ae4a5
Use assertTrue instead of assertEquals(true, expression)
since assertTrue/assertFalse are specifically written for these assertions
14 Jul 2020
achilep <you@example.com>
41665fd864c6b43af841d4199bfd889ab9a3faa3
41665fd864c6b43af841d4199bfd889ab9a3faa3
TRUNK-5816 : Migrate api package tests to Junit 5
14 Jul 2020
teleivo <teleivo@users.noreply.github.com>
99a8057e52a899169d2a731111217eea11cff5a7
99a8057e52a899169d2a731111217eea11cff5a7
Use assertThrows instead of try/catch in tests
this idiom seems to stem from the JUnit 3 times
https://github.com/junit-team/junit4/wiki/Exception-testing#trycatch-idiom
now with JUnit 4/5 the preferred approach is assertThrows
https://github.com/junit-team/junit4/wiki/Exception-testing#using-assertthrows-method
14 Jul 2020