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());
//    }
}
相关推荐
tuyanfei2 分钟前
Spring 简介
java·后端·spring
遥遥晚风点点2 分钟前
JAVA http请求报错:unable to find valid certification path to requested target
java·网络·网络协议·http
ZhengEnCi3 分钟前
J0A-JPA持久化技术专栏链接目录
java·数据库
代码探秘者5 分钟前
【大模型应用】2.RAG详细流程
java·开发语言·人工智能·后端·python
xieliyu.9 分钟前
Java :类和对象(一)
java·开发语言
xuboyok218 分钟前
Spring Boot管理用户数据
java·spring boot·后端
阳光下的米雪27 分钟前
记一次pgsql中with as语法的使用以及with as介绍
java·数据库
qq_3677193029 分钟前
Android MQTT开源库paho.mqtt.android+MQTTX软件使用记录
android·java·开源·android mqtt开源库·mqttx软件使用
6+h30 分钟前
【java IO】字节流详解
java·开发语言·python
Mem0rin31 分钟前
[Java面向对象]接口的声明和实现继承
java·开发语言