Last active
August 31, 2016 11:27
-
-
Save childnode/295dbd6e1ce3f90abe4b15cb10366650 to your computer and use it in GitHub Desktop.
JUnit to JUnit hamcrest - assertThat(sth, hasSize(expectedSize)) using org.hamcrest.MatcherAssert.assertThat and org.hamcrest.Matchers.hasSize
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
s | |
| | |
assertNotNull\((?:\s*([^,;$]+))\s*\) | |
| | |
assertThat\($1, notNullValue\(\)\) | |
| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
s | |
| | |
assertEquals\((?:(\d+)\s*),(?:\s*([^,;$]+))\.size\(\)\) | |
| | |
assertThat\($2, hasSize\($1\)\) | |
| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
s | |
| | |
assertEquals\((?:([^,]+)\s*),(?:\s*([^,;$]+))\) | |
| | |
assertThat\($2, is\($1\)\) | |
| |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment