diff --git a/junit5/pom.xml b/junit5/pom.xml
new file mode 100644
index 0000000000..5a2ea61668
--- /dev/null
+++ b/junit5/pom.xml
@@ -0,0 +1,83 @@
+
+
+ 4.0.0
+
+ com.baeldung
+ junit5
+ 1.0-SNAPSHOT
+
+ junit5
+ Intro to JUnit 5
+
+
+ UTF-8
+ 1.8
+
+ 5.0.0-SNAPSHOT
+
+
+
+
+ snapshots-repo
+ https://oss.sonatype.org/content/repositories/snapshots
+
+ false
+
+
+
+ always
+ true
+
+
+
+
+
+
+ snapshots-repo
+ https://oss.sonatype.org/content/repositories/snapshots
+
+ false
+
+
+
+ always
+ true
+
+
+
+
+
+
+
+ maven-compiler-plugin
+ 3.1
+
+ ${java.version}
+ ${java.version}
+
+
+
+ maven-surefire-plugin
+ 2.19
+
+
+ org.junit
+ surefire-junit5
+ ${junit.gen5.version}
+
+
+
+
+
+
+
+
+ org.junit
+ junit5-api
+ ${junit.gen5.version}
+ test
+
+
+
\ No newline at end of file
diff --git a/junit5/src/test/java/com/baeldung/AssumptionTest.java b/junit5/src/test/java/com/baeldung/AssumptionTest.java
new file mode 100644
index 0000000000..e4c2b56124
--- /dev/null
+++ b/junit5/src/test/java/com/baeldung/AssumptionTest.java
@@ -0,0 +1,30 @@
+package com.baeldung;
+
+import org.junit.gen5.api.Test;
+
+import static org.junit.gen5.api.Assertions.assertEquals;
+import static org.junit.gen5.api.Assumptions.*;
+
+public class AssumptionTest {
+
+ @Test
+ void trueAssumption() {
+ assumeTrue(5 > 1);
+ assertEquals(5 + 2, 7);
+ }
+
+ @Test
+ void falseAssumption() {
+ assumeFalse(5 < 1);
+ assertEquals(5 + 2, 7);
+ }
+
+ @Test
+ void assumptionThat() {
+ String someString = "Just a string";
+ assumingThat(
+ someString.equals("Just a string"),
+ () -> assertEquals(2 + 2, 4)
+ );
+ }
+}
diff --git a/junit5/src/test/java/com/baeldung/ExceptionTest.java b/junit5/src/test/java/com/baeldung/ExceptionTest.java
new file mode 100644
index 0000000000..5c30ad5b44
--- /dev/null
+++ b/junit5/src/test/java/com/baeldung/ExceptionTest.java
@@ -0,0 +1,18 @@
+package com.baeldung;
+
+import org.junit.gen5.api.Test;
+
+import static org.junit.gen5.api.Assertions.assertEquals;
+import static org.junit.gen5.api.Assertions.expectThrows;
+
+public class ExceptionTest {
+
+ @Test
+ void shouldThrowException() {
+ Throwable exception = expectThrows(UnsupportedOperationException.class,
+ () -> {
+ throw new UnsupportedOperationException("Not supported");
+ });
+ assertEquals(exception.getMessage(), "Not supported");
+ }
+}
diff --git a/junit5/src/test/java/com/baeldung/FirstTest.java b/junit5/src/test/java/com/baeldung/FirstTest.java
new file mode 100644
index 0000000000..4fc6037174
--- /dev/null
+++ b/junit5/src/test/java/com/baeldung/FirstTest.java
@@ -0,0 +1,37 @@
+package com.baeldung;
+
+import org.junit.gen5.api.Disabled;
+import org.junit.gen5.api.Test;
+
+import java.util.Arrays;
+import java.util.List;
+
+import static org.junit.gen5.api.Assertions.*;
+
+class FirstTest {
+
+ @Test
+ void lambdaExpressions() {
+ List numbers = Arrays.asList(1, 2, 3);
+ assertTrue(numbers
+ .stream()
+ .mapToInt(i -> i)
+ .sum() > 5, "Sum should be greater than 5");
+ }
+
+ @Test
+ void groupAssertions() {
+ int[] numbers = {0, 1, 2, 3, 4};
+ assertAll("numbers",
+ () -> assertEquals(numbers[0], 1),
+ () -> assertEquals(numbers[3], 3),
+ () -> assertEquals(numbers[4], 1)
+ );
+ }
+
+ @Test
+ @Disabled
+ void disabledTest() {
+ assertTrue(false);
+ }
+}
diff --git a/junit5/src/test/java/com/baeldung/NestedTest.java b/junit5/src/test/java/com/baeldung/NestedTest.java
new file mode 100644
index 0000000000..3fbe4f8644
--- /dev/null
+++ b/junit5/src/test/java/com/baeldung/NestedTest.java
@@ -0,0 +1,77 @@
+package com.baeldung;
+
+import org.junit.gen5.api.*;
+
+import java.util.EmptyStackException;
+import java.util.Stack;
+
+public class NestedTest {
+ Stack