Created
March 5, 2021 17:04
-
-
Save beyondxscratch/dec7d784560690921c9b9a484c07f24f 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.AfterAll; | |
import org.junit.jupiter.api.AfterEach; | |
import org.junit.jupiter.api.BeforeAll; | |
import org.junit.jupiter.api.BeforeEach; | |
import org.junit.jupiter.api.Test; | |
import org.junit.jupiter.api.TestInstance; | |
import static org.junit.jupiter.api.TestInstance.Lifecycle.PER_METHOD; | |
@TestInstance(PER_METHOD) //valeur par défaut, pas besion de le spécifier | |
class MyTest { | |
@BeforeAll | |
static void avantTousLesTests(){} | |
@AfterAll | |
static void apresTousLesTests(){} | |
@BeforeEach | |
void avantChaqueTest(){} | |
@AfterEach | |
void apresChaqueTest(){} | |
@Test | |
void unTest(){} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment