Last active
April 4, 2021 09:02
-
-
Save mehmetcemyucel/425230ee4b13048a97cf09cb1107740c to your computer and use it in GitHub Desktop.
springboot-junit-rule
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
public class WithoutExpectedExceptionTest { | |
@Test(expected = NullPointerException.class) | |
public void test() { | |
String value = null; | |
value.split(""); | |
} | |
@Test(expected = ArithmeticException.class) | |
public void test2() { | |
int val1 = 3, val2 = 0; | |
val1 = val1 / val2; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment