Merge pull request #128 from goerge/junit5

migrate to JUnit 5
This commit is contained in:
Emily Bache 2019-11-18 19:04:59 +01:00 committed by GitHub
commit 8d957a5ab4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 8 deletions

View File

@ -11,13 +11,15 @@
<properties>
<java.version>1.8</java.version>
<junit.jupiter.version>5.5.2</junit.jupiter.version>
<maven.maven-surefire-plugin.version>2.22.2</maven.maven-surefire-plugin.version>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${junit.jupiter.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
@ -31,7 +33,11 @@
<target>${java.version}</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.maven-surefire-plugin.version}</version>
</plugin>
</plugins>
</build>
</project>
</project>

View File

@ -1,13 +1,13 @@
package com.gildedrose;
import static org.junit.Assert.*;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
public class GildedRoseTest {
class GildedRoseTest {
@Test
public void foo() {
void foo() {
Item[] items = new Item[] { new Item("foo", 0, 0) };
GildedRose app = new GildedRose(items);
app.updateQuality();