diff --git a/pom.xml b/pom.xml index c921cec..3668646 100644 --- a/pom.xml +++ b/pom.xml @@ -11,4 +11,12 @@ 17 17 + + + org.junit.jupiter + junit-jupiter + 5.12.2 + test + + \ No newline at end of file diff --git a/src/main/java/com/example/App.java b/src/main/java/com/example/App.java index 594d998..a6e9422 100644 --- a/src/main/java/com/example/App.java +++ b/src/main/java/com/example/App.java @@ -4,5 +4,10 @@ public class App { public static void main(String[] args) { System.out.println("Hello, World!"); } + + public String greet() { + return "Hello, World!"; + } + } diff --git a/src/test/java/com/example/AppTest.java b/src/test/java/com/example/AppTest.java new file mode 100644 index 0000000..acec55a --- /dev/null +++ b/src/test/java/com/example/AppTest.java @@ -0,0 +1,8 @@ +package com.example; + +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; + +public class AppTest { + @Test public void testGreet() { App app = new App(); assertEquals("Hello, World!", app.greet()); } +}