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());
//    }
}
相关推荐
2401_cf2 小时前
为什么hadoop不用Java的序列化?
java·hadoop·eclipse
帮帮志2 小时前
idea整合maven环境配置
java·maven·intellij-idea
LuckyTHP2 小时前
java 使用zxing生成条形码(可自定义文字位置、边框样式)
java·开发语言·python
无声旅者5 小时前
深度解析 IDEA 集成 Continue 插件:提升开发效率的全流程指南
java·ide·ai·intellij-idea·ai编程·continue·openapi
Ryan-Joee5 小时前
Spring Boot三层架构设计模式
java·spring boot
Hygge-star5 小时前
【数据结构】二分查找5.12
java·数据结构·程序人生·算法·学习方法
dkmilk6 小时前
Tomcat发布websocket
java·websocket·tomcat
工一木子6 小时前
【Java项目脚手架系列】第七篇:Spring Boot + Redis项目脚手架
java·spring boot·redis
哞哞不熬夜6 小时前
JavaEE--初识网络
java·网络·java-ee
等等5436 小时前
Java EE初阶——wait 和 notify
java·开发语言