移除junit4,使用默认junit5

This commit is contained in:
EightMonth
2025-03-27 16:58:35 +08:00
parent a27b94c4c6
commit 5ff1b56fe2
15 changed files with 24 additions and 47 deletions

View File

@ -14,11 +14,9 @@ import org.jeecg.common.constant.enums.MessageTypeEnum;
import org.jeecg.common.constant.enums.SysAnnmentTypeEnum;
import org.jeecg.common.system.api.ISysBaseAPI;
import org.jeecg.common.util.DySmsHelper;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import java.util.HashMap;
import java.util.Map;
@ -27,7 +25,6 @@ import java.util.Map;
* @Description: 消息推送测试
* @Author: lsq
*/
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = JeecgSystemApplication.class)
public class SendMessageTest {

View File

@ -6,20 +6,17 @@ import org.jeecg.common.constant.CommonConstant;
import org.jeecg.common.system.util.JwtUtil;
import org.jeecg.common.util.RedisUtil;
import org.jeecg.common.util.RestUtil;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.test.context.junit4.SpringRunner;
/**
* 系统用户单元测试
*/
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,classes = JeecgSystemApplication.class)
public class InsertDemoTest {
/**

View File

@ -6,16 +6,13 @@ import org.jeecg.modules.demo.test.entity.JeecgDemo;
import org.jeecg.modules.demo.test.mapper.JeecgDemoMapper;
import org.jeecg.modules.demo.test.service.IJeecgDemoService;
import org.jeecg.modules.system.service.ISysDataLogService;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import javax.annotation.Resource;
import java.util.List;
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,classes = JeecgSystemApplication.class)
public class SampleTest {
@ -32,7 +29,7 @@ public class SampleTest {
public void testSelect() {
System.out.println(("----- selectAll method test ------"));
List<JeecgDemo> userList = jeecgDemoMapper.selectList(null);
Assert.assertEquals(5, userList.size());
Assertions.assertEquals(5, userList.size());
userList.forEach(System.out::println);
}

View File

@ -4,9 +4,8 @@ import org.jeecg.JeecgSystemApplication;
import org.jeecg.common.system.api.ISysBaseAPI;
import org.jeecg.config.JeecgBaseConfig;
import org.jeecg.config.firewall.SqlInjection.IDictTableWhiteListHandler;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@ -15,7 +14,6 @@ import org.springframework.test.context.junit4.SpringRunner;
* @Description: 系统表白名单测试
* @Author: sunjianlei
*/
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = JeecgSystemApplication.class)
public class SysTableWhiteCheckTest {
@ -27,7 +25,7 @@ public class SysTableWhiteCheckTest {
@Autowired
JeecgBaseConfig jeecgBaseConfig;
@Before
@BeforeEach
public void before() {
String lowCodeMode = this.jeecgBaseConfig.getFirewall().getLowCodeMode();
System.out.println("当前 LowCode 模式为: " + lowCodeMode);

View File

@ -6,8 +6,7 @@ import org.jeecg.common.constant.CommonConstant;
import org.jeecg.common.system.util.JwtUtil;
import org.jeecg.common.util.RedisUtil;
import org.jeecg.common.util.RestUtil;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.HttpHeaders;
@ -19,7 +18,6 @@ import org.springframework.test.context.junit4.SpringRunner;
/**
* 系统用户单元测试
*/
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,classes = JeecgSystemApplication.class)
public class SysUserTest {
/**

View File

@ -1,6 +1,6 @@
package org.jeecg.smallTools;
import org.junit.Test;
import org.junit.jupiter.api.Test;
/**
* 测试sql分割、替换等操作

View File

@ -2,7 +2,7 @@ package org.jeecg.smallTools;
import com.alibaba.fastjson.JSONArray;
import org.apache.commons.lang3.StringUtils;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import java.text.MessageFormat;
import java.util.Arrays;