Migrate to JUnit5
This commit is contained in:
@@ -34,8 +34,13 @@
|
||||
<artifactId>callback</artifactId>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter-api</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter-engine</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
@@ -22,7 +22,7 @@
|
||||
*/
|
||||
package com.iluwatar.callback;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
|
@@ -22,9 +22,9 @@
|
||||
*/
|
||||
package com.iluwatar.callback;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
* Add a field as a counter. Every time the callback method is called increment this field. Unit
|
||||
@@ -47,15 +47,15 @@ public class CallbackTest {
|
||||
|
||||
Task task = new SimpleTask();
|
||||
|
||||
assertEquals("Initial calling count of 0", new Integer(0), callingCount);
|
||||
assertEquals(new Integer(0), callingCount, "Initial calling count of 0");
|
||||
|
||||
task.executeWith(callback);
|
||||
|
||||
assertEquals("Callback called once", new Integer(1), callingCount);
|
||||
assertEquals(new Integer(1), callingCount, "Callback called once");
|
||||
|
||||
task.executeWith(callback);
|
||||
|
||||
assertEquals("Callback called twice", new Integer(2), callingCount);
|
||||
assertEquals(new Integer(2), callingCount, "Callback called twice");
|
||||
|
||||
}
|
||||
|
||||
@@ -65,15 +65,15 @@ public class CallbackTest {
|
||||
|
||||
Task task = new SimpleTask();
|
||||
|
||||
assertEquals("Initial calling count of 0", new Integer(0), callingCount);
|
||||
assertEquals(new Integer(0), callingCount, "Initial calling count of 0");
|
||||
|
||||
task.executeWith(callback);
|
||||
|
||||
assertEquals("Callback called once", new Integer(1), callingCount);
|
||||
assertEquals(new Integer(1), callingCount, "Callback called once");
|
||||
|
||||
task.executeWith(callback);
|
||||
|
||||
assertEquals("Callback called twice", new Integer(2), callingCount);
|
||||
assertEquals(new Integer(2), callingCount, "Callback called twice");
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user