mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-19 13:26:33 +00:00
Updated update-method module to JUnit 5 (#1542)
* Updated saga to JUnit 5 * Update fix for CI job in trampoline module * Updated update-method module to JUnit 5 * Upgraded to latest JUnit Jupiter JUnit 4 is not needed when using JUnit-Vintage * Reverted change to access modifier on Trampoline * Cleanup to resolve code smells * Formatting * Formatting Co-authored-by: Subhrodip Mohanta <hello@subho.xyz>
This commit is contained in:
@@ -23,41 +23,44 @@
|
||||
|
||||
package com.iluwatar.updatemethod;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
public class WorldTest {
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
private World world;
|
||||
class WorldTest {
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
private static World world;
|
||||
|
||||
@BeforeAll
|
||||
public static void setup() {
|
||||
world = new World();
|
||||
}
|
||||
|
||||
@After
|
||||
public void tearDown() {
|
||||
@AfterAll
|
||||
public static void tearDown() {
|
||||
world = null;
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRun() {
|
||||
void testRun() {
|
||||
world.run();
|
||||
Assert.assertEquals(true, world.isRunning);
|
||||
assertTrue(world.isRunning);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testStop() {
|
||||
void testStop() {
|
||||
world.stop();
|
||||
Assert.assertEquals(false, world.isRunning);
|
||||
assertFalse(world.isRunning);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAddEntity() {
|
||||
void testAddEntity() {
|
||||
var entity = new Skeleton(1);
|
||||
world.addEntity(entity);
|
||||
Assert.assertEquals(entity, world.entities.get(0));
|
||||
assertEquals(entity, world.entities.get(0));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user