Skip to content
Snippets Groups Projects
Commit 695f3203 authored by Goik Martin's avatar Goik Martin
Browse files

Junit 5 upgrade

parent 61c65f95
No related branches found
No related tags found
No related merge requests found
......@@ -14,6 +14,14 @@
<description>Modified from maven-archetype-quickstart using Java 1.8, log4j 2.x and Junit 4</description>
</archetype>
<archetype>
<groupId>de.hdm-stuttgart.mi</groupId>
<artifactId>mi-maven-archetype-quickstart</artifactId>
<version>1.2</version>
<repository>https://maven.mi.hdm-stuttgart.de/Archetypes</repository>
<description>Modified from maven-archetype-quickstart using Java 1.8, log4j 2.x and Junit 4</description>
</archetype>
<archetype>
<groupId>de.hdm-stuttgart.mi</groupId>
<artifactId>mi-maven-archetype-javafxml</artifactId>
......
......@@ -4,7 +4,7 @@
<groupId>de.hdm-stuttgart.mi</groupId>
<artifactId>mi-maven-archetype-quickstart</artifactId>
<version>1.1</version>
<version>1.2</version>
<packaging>jar</packaging>
<distributionManagement> <!-- mvn deploy -->
......
......@@ -17,9 +17,16 @@
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.1.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.1.0</version>
<scope>test</scope>
</dependency>
......
......@@ -26,4 +26,15 @@ public class App {
log.debug("This config file 'log4j2.xml' will result in 'A1.log'");
log.debug("file containing logging output as well.");
}
/**
* This method purely exists for providing Junit tests.
*
* @param a first parameter
* @param b second parameter
* @return the sum of both parameters.
*/
public static int add(final int a, final int b) {
return a + b;
}
}
package $package;
import org.junit.Assert;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
/**
* Unit test for simple App.
......@@ -12,6 +12,6 @@ public class AppTest {
*/
@Test
public void testApp() {
Assert.assertTrue( true );
Assertions.assertEquals( 33, App.add(30, 3));
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment