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,8 +34,13 @@
<artifactId>lazy-loading</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>

View File

@ -22,11 +22,13 @@
*/
package com.iluwatar.lazy.loading;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import static junit.framework.Assert.assertNotNull;
import static junit.framework.Assert.assertSame;
import static junit.framework.TestCase.assertNull;
import static java.time.Duration.ofMillis;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertSame;
import static org.junit.jupiter.api.Assertions.assertTimeout;
/**
* Date: 12/19/15 - 11:58 AM
@ -52,12 +54,14 @@ public abstract class AbstractHolderTest {
/**
* This test shows that the heavy field is not instantiated until the method getHeavy is called
*/
@Test(timeout = 3000)
@Test
public void testGetHeavy() throws Exception {
assertNull(getInternalHeavyValue());
assertNotNull(getHeavy());
assertNotNull(getInternalHeavyValue());
assertSame(getHeavy(), getInternalHeavyValue());
assertTimeout(ofMillis(3000), () -> {
assertNull(getInternalHeavyValue());
assertNotNull(getHeavy());
assertNotNull(getInternalHeavyValue());
assertSame(getHeavy(), getInternalHeavyValue());
});
}
}

View File

@ -22,7 +22,7 @@
*/
package com.iluwatar.lazy.loading;
import org.junit.Test;
import org.junit.jupiter.api.Test;
/**
*