Skip to content

Commit

Permalink
tests: Move to JUnit 5
Browse files Browse the repository at this point in the history
  • Loading branch information
NotMyFault committed Dec 7, 2021
1 parent b9a130a commit f981c86
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 17 deletions.
8 changes: 4 additions & 4 deletions Core/src/test/java/com/plotsquared/core/plot/FlagTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@
import com.sk89q.worldedit.world.item.ItemType;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;

public class FlagTest {

private static final Logger LOGGER = LogManager.getLogger("PlotSquared/" + FlagTest.class.getSimpleName());

private ItemType testBlock;

@Before
@BeforeEach
public void setUp() throws Exception {
//EventUtil.manager = new EventUtilTest();
DBFunc.dbManager = new AbstractDBTest();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,17 @@
*/
package com.plotsquared.core.plot;


import org.junit.jupiter.api.Test;

import java.util.Arrays;
import java.util.List;
import java.util.NoSuchElementException;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;

public class PlotRangeIteratorTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import com.plotsquared.core.PlotVersion;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.junit.Test;
import org.junit.jupiter.api.Test;

public class PlotVersionTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,9 @@ void useLockUnlock() {
throw new IllegalStateException("Expected a ReentrantLock");
}

assertThrows(IllegalStateException.class, () -> {
this.lockRepository.useLock(this.key, () -> {
throw new IllegalStateException();
});
});
assertThrows(IllegalStateException.class, () -> this.lockRepository.useLock(this.key, () -> {
throw new IllegalStateException();
}));
assertFalse(lock.isLocked());
}
}
1 change: 0 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ val javadocDir = rootDir.resolve("docs").resolve("javadoc").resolve(project.name
allprojects {
dependencies {
// Tests
testImplementation("junit:junit:4.13.2")
testImplementation("org.junit.jupiter:junit-jupiter:5.8.2")
}

Expand Down

0 comments on commit f981c86

Please sign in to comment.