Migrate to JUnit5

This commit is contained in:
Artur Mogozov
2017-12-31 16:29:48 +09:00
parent a20e54d0a7
commit 6694d742a3
408 changed files with 2656 additions and 2165 deletions

View File

@ -34,13 +34,13 @@
<artifactId>factory-method</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.mockito</groupId>
<artifactId>mockito-core</artifactId>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

View File

@ -22,7 +22,7 @@
*/
package com.iluwatar.factory.method;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import java.io.IOException;

View File

@ -22,10 +22,10 @@
*/
package com.iluwatar.factory.method;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import org.junit.jupiter.api.Test;
import org.junit.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
/**
* The Factory Method is a creational design pattern which uses factory methods to deal with the
@ -94,8 +94,7 @@ public class FactoryMethodTest {
* @param clazz expected class of the weapon
*/
private void verifyWeapon(Weapon weapon, WeaponType expectedWeaponType, Class<?> clazz) {
assertTrue("Weapon must be an object of: " + clazz.getName(), clazz.isInstance(weapon));
assertEquals("Weapon must be of weaponType: " + expectedWeaponType, expectedWeaponType,
weapon.getWeaponType());
assertTrue(clazz.isInstance(weapon), "Weapon must be an object of: " + clazz.getName());
assertEquals(expectedWeaponType, weapon.getWeaponType(), "Weapon must be of weaponType: " + expectedWeaponType);
}
}