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());
//    }
}
相关推荐
Chan166 分钟前
场景题:CPU 100% 问题怎么排查?
java·数据库·redis·后端·spring
qq_3363139329 分钟前
java基础-IO流(网络爬虫/工具包生成假数据)
java·爬虫·php
桦说编程1 小时前
滑动窗口限流器的演进之路:从调度器实现到 Packed CAS
java·后端·性能优化
开开心心_Every1 小时前
安卓后台录像APP:息屏录存片段,行车用
java·服务器·前端·学习·eclipse·edge·powerpoint
初次攀爬者1 小时前
SpringBoot 整合 JWT + Redis 实现登录鉴权
java·redis·后端
悦悦妍妍1 小时前
spring-ioc
java
佛系打工仔2 小时前
绘制K线第一章:可见区间处理
java
wangkay882 小时前
【Java 转运营】Day02:抖音直播间流量底层逻辑全解析
java·新媒体运营
5***b972 小时前
Spring Boot--@PathVariable、@RequestParam、@RequestBody
java·spring boot·后端