Skip to content

Instantly share code, notes, and snippets.

@muditlambda
Created December 29, 2021 11:30
Show Gist options
  • Save muditlambda/10267d693934be74de3907c6eb37e1fc to your computer and use it in GitHub Desktop.
Save muditlambda/10267d693934be74de3907c6eb37e1fc to your computer and use it in GitHub Desktop.
package ParallelTestsInJUnit;
import org.junit.jupiter.api.*;
public class DemoTest1 {
@BeforeAll
public static void start() {
System.out.println("=======Starting junit 5 tests========");
}
@Test
@DisplayName("Login_Test")
void DemoTest1_A() {
System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()+" => executed successfully");
}
@Test
@DisplayName("Product_Test")
void DemoTest1_B() {
System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()+" => executed successfully");
}
@Test
@DisplayName("Home_Test")
void DemoTest1_C() {
System.out.println(Thread.currentThread().getStackTrace()[1].getMethodName()+" => executed successfully");
}
@AfterAll
public static void end() {
System.out.println("All the tests are executed successfully");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment