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,36 +23,37 @@
|
||||
|
||||
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 StatueTest {
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
private Statue statue;
|
||||
class StatueTest {
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
private static Statue statue;
|
||||
|
||||
@BeforeAll
|
||||
public static void setup() {
|
||||
statue = new Statue(1, 20);
|
||||
}
|
||||
|
||||
@After
|
||||
public void tearDown() {
|
||||
@AfterAll
|
||||
public static void tearDown() {
|
||||
statue = null;
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUpdateForPendingShoot() {
|
||||
void testUpdateForPendingShoot() {
|
||||
statue.frames = 10;
|
||||
statue.update();
|
||||
Assert.assertEquals(11, statue.frames);
|
||||
assertEquals(11, statue.frames);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUpdateForShooting() {
|
||||
void testUpdateForShooting() {
|
||||
statue.frames = 19;
|
||||
statue.update();
|
||||
Assert.assertEquals(0, statue.frames);
|
||||
assertEquals(0, statue.frames);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user