Created
March 11, 2021 14:39
-
-
Save beyondxscratch/e86434b91a6d394309138839b9762896 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.jupiter.api.BeforeEach; | |
import org.junit.jupiter.api.Nested; | |
import org.junit.jupiter.api.Test; | |
public class NestedTests { | |
@BeforeEach | |
void globalSetup() { | |
System.out.println("A"); | |
} | |
@Test | |
void test1() { | |
System.out.println("1"); | |
} | |
@Test | |
void test2() { | |
System.out.println("2"); | |
} | |
@Nested | |
class Inside { | |
@BeforeEach | |
void localSetup() { | |
System.out.println("B"); | |
} | |
@Test | |
void test3() { | |
System.out.println("3"); | |
} | |
@Test | |
void test4() { | |
System.out.println("4"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment