Fix unittest not running with mvn build

This commit is contained in:
aletta.codes 2022-03-22 20:43:14 +01:00
parent d83aa3ca8c
commit 9536fcdc69
2 changed files with 8 additions and 4 deletions

View File

@ -20,7 +20,7 @@
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit.jupiter.version}</version>
<scope>test</scope>
</dependency>
@ -37,8 +37,10 @@
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.maven-surefire-plugin.version}</version>
<!-- JUnit 5 requires Surefire version 2.22.0 or higher -->
<version>2.22.0</version>
</plugin>
</plugins>
</build>

View File

@ -1,12 +1,14 @@
package com.gildedrose;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
import org.junit.jupiter.api.TestInstance.Lifecycle;
import org.junit.jupiter.api.BeforeAll;
import static org.junit.jupiter.api.Assertions.*;
class GildedRoseTest {
@TestInstance(Lifecycle.PER_CLASS)
public class GildedRoseTest {
GildedRose app;