#909: Update tests to JUnit 5

By: DerFrZocker <derrieple@gmail.com>
This commit is contained in:
Bukkit/Spigot
2023-09-24 06:09:10 +10:00
parent eef02e5dd2
commit 2a6d2d27d7
50 changed files with 837 additions and 863 deletions

View File

@ -1,9 +1,9 @@
package org.bukkit.metadata;
import static org.junit.Assert.*;
import static org.junit.jupiter.api.Assertions.*;
import java.util.concurrent.Callable;
import org.bukkit.plugin.TestPlugin;
import org.junit.Test;
import org.junit.jupiter.api.Test;
public class LazyMetadataValueTest {
private LazyMetadataValue subject;
@ -41,7 +41,7 @@ public class LazyMetadataValueTest {
assertEquals(value, subject.value());
}
@Test(expected = MetadataEvaluationException.class)
@Test
public void testEvalException() {
subject = new LazyMetadataValue(plugin, LazyMetadataValue.CacheStrategy.CACHE_AFTER_FIRST_EVAL, new Callable<Object>() {
@Override
@ -49,7 +49,7 @@ public class LazyMetadataValueTest {
throw new RuntimeException("Gotcha!");
}
});
subject.value();
assertThrows(MetadataEvaluationException.class, () -> subject.value());
}
@Test