Last active
July 20, 2016 19:40
-
-
Save jarrad/01eaa79f4752f6e51b13e68de7da3fba to your computer and use it in GitHub Desktop.
Assert an Exception was thrown in JUnit with lambdas
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
assertThrows(MyException.class, | |
() -> systemUnderTest.throwingMethod()); | |
// now do other testy things |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment