Update to JUnit5 across all modules (#1668)
* 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 * Migrating to JUnit5 and updating some Mockito patterns * Migrating to JUnit5 * Migrating to JUnit5 * Migrating to JUnit 5 * Formatting cleanup * Added missing scope for junit * Fixed tests that were not running previously. Co-authored-by: Subhrodip Mohanta <hello@subho.xyz>
This commit is contained in:
@ -38,10 +38,6 @@
|
||||
<artifactId>junit-jupiter-engine</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
|
@ -23,15 +23,17 @@
|
||||
|
||||
package com.iluwatar.singleton;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Date: 12/29/15 - 19:26 PM.
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class ThreadSafeDoubleCheckLockingTest extends SingletonTest<ThreadSafeDoubleCheckLocking> {
|
||||
class ThreadSafeDoubleCheckLockingTest extends SingletonTest<ThreadSafeDoubleCheckLocking> {
|
||||
|
||||
/**
|
||||
* Create a new singleton test instance using the given 'getInstance' method.
|
||||
@ -43,12 +45,12 @@ public class ThreadSafeDoubleCheckLockingTest extends SingletonTest<ThreadSafeDo
|
||||
/**
|
||||
* Test creating new instance by refection.
|
||||
*/
|
||||
@Test(expected = InvocationTargetException.class)
|
||||
public void testCreatingNewInstanceByRefection() throws Exception {
|
||||
@Test
|
||||
void testCreatingNewInstanceByRefection() throws Exception {
|
||||
ThreadSafeDoubleCheckLocking.getInstance();
|
||||
var constructor = ThreadSafeDoubleCheckLocking.class.getDeclaredConstructor();
|
||||
constructor.setAccessible(true);
|
||||
constructor.newInstance((Object[]) null);
|
||||
assertThrows(InvocationTargetException.class, () -> constructor.newInstance((Object[]) null));
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user