java 单元测试 junit 4使用

需要的maven 包

xml 复制代码
		<!-- https://mvnrepository.com/artifact/junit/junit -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.13.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>

java 注解

java 复制代码
package com.basehuman.manager.service;

import com.basehuman.BaseHumanApplication;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;



@RunWith(SpringRunner.class)
@SpringBootTest(classes = BaseHumanApplication.class)
public class MiniTest {

//    @Autowired
//    private FollowRecordService followRecordService;
//
//    @Test
//    public void miniAccountFollowRecordList() {
//
//        MiniRecordVo vo = new MiniRecordVo();
//        vo.setAccountId(220L);
//        List<MiniFollowRecordPo> list = followRecordService.miniAccountFollowRecordList(vo);
//        System.out.println(list.size());
//    }
}
相关推荐
无敌最俊朗@24 分钟前
STL-vector面试剖析(面试复习4)
java·面试·职场和发展
PPPPickup39 分钟前
easychat项目复盘---获取联系人列表,联系人详细,删除拉黑联系人
java·前端·javascript
LiamTuc1 小时前
Java构造函数
java·开发语言
长安er1 小时前
LeetCode 206/92/25 链表翻转问题-“盒子-标签-纸条模型”
java·数据结构·算法·leetcode·链表·链表翻转
菜鸟plus+1 小时前
N+1查询
java·服务器·数据库
我要添砖java1 小时前
《JAVAEE》网络编程-什么是网络?
java·网络·java-ee
CoderYanger1 小时前
动态规划算法-01背包问题:50.分割等和子集
java·算法·leetcode·动态规划·1024程序员节
菜鸟233号3 小时前
力扣513 找树左下角的值 java实现
java·数据结构·算法·leetcode
Neoest4 小时前
【EasyExcel 填坑日记】“Syntax error on token )“: 一次编译错误在逃 Runtime 的灵异事件
java·eclipse·编辑器
自在极意功。4 小时前
Web开发中的分层解耦
java·microsoft·web开发·解耦