diff --git a/pom.xml b/pom.xml index 84133d0..91e271b 100644 --- a/pom.xml +++ b/pom.xml @@ -39,5 +39,54 @@ 11 ${java.version} ${java.version} + 5.3.1 + + + + + org.junit.jupiter + junit-jupiter-api + ${junit-platform-version} + test + + + + org.junit.jupiter + junit-jupiter-engine + ${junit-platform-version} + test + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.0 + + + --illegal-access=permit + + + + + org.apache.maven.plugins + maven-failsafe-plugin + 2.22.0 + + + --illegal-access=permit + + + + + \ No newline at end of file diff --git a/src/test/java/guru/springframework/GreatingTest.java b/src/test/java/guru/springframework/GreatingTest.java new file mode 100644 index 0000000..f08154c --- /dev/null +++ b/src/test/java/guru/springframework/GreatingTest.java @@ -0,0 +1,44 @@ +package guru.springframework; + +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 static org.junit.jupiter.api.Assertions.*; + +class GreatingTest { + + private Greating greeting; + @BeforeAll + public static void beforeClass(){ + System.out.println("before class"); + } + + @BeforeEach + void setUp() { + System.out.println("before each"); + greeting=new Greating(); + } + + @Test + void helloWorld() { + System.out.println("test 1"); + } + + @Test + void testHelloWorld() { + System.out.println("test 2"); + } + + @AfterEach + void tearDown() { + System.out.println("after each"); + } + + @BeforeAll + public static void beforeClass(){ + System.out.println("before class"); + } + +} \ No newline at end of file