mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
单元测试由Junit4变更为Junit5
This commit is contained in:
@@ -2,7 +2,7 @@ package cn.hutool.script.test;
|
||||
|
||||
|
||||
import cn.hutool.core.io.resource.ResourceUtil;
|
||||
import org.junit.Assert;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
import javax.script.Invocable;
|
||||
import javax.script.ScriptEngine;
|
||||
@@ -17,6 +17,6 @@ public class NashornDeepTest {
|
||||
engine.eval(ResourceUtil.readUtf8Str("filter1.js"));
|
||||
|
||||
final Object filter1 = ((Invocable) engine).invokeFunction("filter1", 1, 2);
|
||||
Assert.assertFalse((Boolean) filter1);
|
||||
assertFalse((Boolean) filter1);
|
||||
}
|
||||
}
|
||||
|
@@ -3,8 +3,8 @@ package cn.hutool.script.test;
|
||||
import cn.hutool.core.io.resource.ResourceUtil;
|
||||
import cn.hutool.script.ScriptRuntimeException;
|
||||
import cn.hutool.script.ScriptUtil;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import javax.script.CompiledScript;
|
||||
import javax.script.ScriptEngine;
|
||||
@@ -12,7 +12,7 @@ import javax.script.ScriptException;
|
||||
|
||||
/**
|
||||
* 脚本单元测试类
|
||||
*
|
||||
*
|
||||
* @author looly
|
||||
*
|
||||
*/
|
||||
@@ -36,7 +36,7 @@ public class ScriptUtilTest {
|
||||
@Test
|
||||
public void invokeTest() {
|
||||
final Object result = ScriptUtil.invoke(ResourceUtil.readUtf8Str("filter1.js"), "filter1", 2, 1);
|
||||
Assert.assertTrue((Boolean) result);
|
||||
assertTrue((Boolean) result);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Reference in New Issue
Block a user