Last active
April 17, 2022 13:33
-
-
Save weikangchia/67682a85f4fb7fe4e7b4feb137124eb3 to your computer and use it in GitHub Desktop.
This file contains 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
import org.junit.Test; | |
public class JUnit4Test { | |
@Test(expected = RuntimeException.class) | |
public void shouldThrowRuntimeException() { | |
throw new RuntimeException("Exception met"); | |
} | |
@Test(timeout = 1) | |
public void shouldTimeoutAfter1Milliseconds() throws InterruptedException { | |
Thread.sleep(500); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment