October 2017
Intermediate to advanced
350 pages
7h 29m
English
The following is the image we want to run the legacy test (JUnit 4 in this case) inside the JUnit Plaform:
package io.github.bonigarcia;import static org.junit.Assert.assertEquals;import org.junit.Test;public class LegacyJUnit4Test { @Test public void myFirstTest() { String message = "1+1 should be equal to 2"; System.out.println(message); assertEquals(message, 2, 1 + 1); }}
To that aim, in Maven, we first need to include the old JUnit 4 dependency in our pom.xml, as follows:
<dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.12</version> <scope>test</scope> </dependency></dependencies>
Then, we need to include maven-surefire-plugin, using the following dependencies for ...
Read now
Unlock full access