单元测试(JUnit、Mockito、PowerMock )

以前编写测试时查阅的链接地址:

How to use JUnit in Eclipse http://www.cse.chalmers.se/edu/year/2012/course/TDA566/juniteclipse.html

Configuring the Build System to Include Required Libraries https://docs.parasoft.com/display/JTEST1042/Configuring+the+Build+System+to+Include+Required+Libraries#ConfiguringtheBuildSystemtoIncludeRequiredLibraries-AddingDependenciesinMaven

JUnit 5 User Guide

https://junit.org/junit5/docs/current/user-guide/

JUnit 5 Tutorial https://howtodoinjava.com/junit-5-tutorial/

Mockito Maven Dependency Example

https://examples.javacodegeeks.com/core-java/mockito/mockito-maven-dependency-example/
6.

Mockito Tutorial (A comprehensive guide with examples)

https://javacodehouse.com/blog/mockito-tutorial/
7.

Mockito Tutorial

https://www.journaldev.com/21816/mockito-tutorial
8.

Getting Started with Mockito https://www.logicbig.com/tutorials/unit-testing/mockito/mockito-getting-started.html

Mockito @InjectMocks -- Mocks Dependency Injection https://www.journaldev.com/21887/mockito-injectmocks-mocks-dependency-injection

复制代码
## Mockito -- Difference between @Mock and @InjectMocks annotations [https://howtodoinjava.com/mockito/mockito-mock-injectmocks/](https://howtodoinjava.com/mockito/mockito-mock-injectmocks/ "https://howtodoinjava.com/mockito/mockito-mock-injectmocks/")
复制代码
## Annotation Magic with Mockito: InjectMocks [https://nearsoft.com/blog/annotation-magic-with-mockito-injectmocks/](https://nearsoft.com/blog/annotation-magic-with-mockito-injectmocks/ "https://nearsoft.com/blog/annotation-magic-with-mockito-injectmocks/")
复制代码
## Unit tests with Mockito - Tutorial

[https://www.vogella.com/tutorials/Mockito/article.html](https://www.vogella.com/tutorials/Mockito/article.html "https://www.vogella.com/tutorials/Mockito/article.html")
复制代码
## Mockito: 3 Ways to Init Mock in JUnit 5

[https://mincong.io/2020/04/19/mockito-junit5/](https://mincong.io/2020/04/19/mockito-junit5/ "https://mincong.io/2020/04/19/mockito-junit5/")
复制代码
## Using Mockito with JUnit [https://java2blog.com/mockito-junit/](https://java2blog.com/mockito-junit/ "https://java2blog.com/mockito-junit/")
复制代码
## Using Mockito for Java Unit Testing

[https://dev.to/nipunarora/using-mockito-for-java-unit-testing-28jp](https://dev.to/nipunarora/using-mockito-for-java-unit-testing-28jp "https://dev.to/nipunarora/using-mockito-for-java-unit-testing-28jp")
  1. Stubbing and Mocking with Mockito and JUnit https://semaphoreci.com/community/tutorials/stubbing-and-mocking-with-mockito-2-and-junit
  2. Testing_with_Mockito https://nisjug.org/wp-content/uploads/2019/03/Testing_with_Mockito.pdf
  3. JUnit 5 and Mockito Example https://howtoprogram.xyz/2018/09/12/junit-5-mockito-example/
复制代码
## Writing Tests with JUnit 5

[https://blog.jetbrains.com/idea/2020/09/writing-tests-with-junit-5/](https://blog.jetbrains.com/idea/2020/09/writing-tests-with-junit-5/ "https://blog.jetbrains.com/idea/2020/09/writing-tests-with-junit-5/")
复制代码
## JUnit 5 tutorial, part 1: Unit testing with JUnit 5, Mockito, and Hamcrest [https://www.infoworld.com/article/3537563/junit-5-tutorial-part-1-unit-testing-with-junit-5-mockito-and-hamcrest.html](https://www.infoworld.com/article/3537563/junit-5-tutorial-part-1-unit-testing-with-junit-5-mockito-and-hamcrest.html "https://www.infoworld.com/article/3537563/junit-5-tutorial-part-1-unit-testing-with-junit-5-mockito-and-hamcrest.html")
复制代码
### Using another JUnit Runner with PowerMock [https://blog.jayway.com/2014/11/29/using-another-junit-runner-with-powermock/](https://blog.jayway.com/2014/11/29/using-another-junit-runner-with-powermock/ "https://blog.jayway.com/2014/11/29/using-another-junit-runner-with-powermock/")
复制代码
## Mockito+PowerMockチートシート[https://qiita.com/y-imai/items/0e002e16e38ba97e11f6](https://qiita.com/y-imai/items/0e002e16e38ba97e11f6 "https://qiita.com/y-imai/items/0e002e16e38ba97e11f6")
  1. Mockito: Why You Still Should Appreciate InjectMocks Annotation https://technology.first8.nl/mockito-why-you-still-should-appreciate-injectmocks-annotation/
复制代码
## Mockito: Why You Should Not Use InjectMocks Annotation to Autowire Fields [https://tedvinke.wordpress.com/2014/02/13/mockito-why-you-should-not-use-injectmocks-annotation-to-autowire-fields/](https://tedvinke.wordpress.com/2014/02/13/mockito-why-you-should-not-use-injectmocks-annotation-to-autowire-fields/ "https://tedvinke.wordpress.com/2014/02/13/mockito-why-you-should-not-use-injectmocks-annotation-to-autowire-fields/")
复制代码
## Mocking Static Methods with Mockito (Java \& Kotlin)[https://rieckpil.de/mocking-static-methods-with-mockito-java-kotlin/](https://rieckpil.de/mocking-static-methods-with-mockito-java-kotlin/ "https://rieckpil.de/mocking-static-methods-with-mockito-java-kotlin/")
复制代码
## Using PowerMock to Mock Static Methods

[https://dzone.com/articles/using-powermock-mock-static](https://dzone.com/articles/using-powermock-mock-static "https://dzone.com/articles/using-powermock-mock-static")
复制代码
### [Mock static methods in JUnit with PowerMock example](https://automationrhapsody.com/mock-static-methods-junit-powermock-example/ "Mock static methods in JUnit with PowerMock example") [https://automationrhapsody.com/mock-static-methods-junit-powermock-example/](https://automationrhapsody.com/mock-static-methods-junit-powermock-example/ "https://automationrhapsody.com/mock-static-methods-junit-powermock-example/")
复制代码
## Spring Boot + JUnit 5 + Mockito

[https://mkyong.com/spring-boot/spring-boot-junit-5-mockito/](https://mkyong.com/spring-boot/spring-boot-junit-5-mockito/ "https://mkyong.com/spring-boot/spring-boot-junit-5-mockito/")
复制代码
### How to Test a Spring Boot Application

[https://stackabuse.com/how-to-test-a-spring-boot-application/](https://stackabuse.com/how-to-test-a-spring-boot-application/ "https://stackabuse.com/how-to-test-a-spring-boot-application/")
复制代码
## Testing MVC Web Controllers with Spring Boot and @WebMvcTest [https://reflectoring.io/spring-boot-web-controller-test/](https://reflectoring.io/spring-boot-web-controller-test/ "https://reflectoring.io/spring-boot-web-controller-test/")
复制代码
## How to test a controller in Spring Boot - a practical guide

[https://thepracticaldeveloper.com/guide-spring-boot-controller-tests/](https://thepracticaldeveloper.com/guide-spring-boot-controller-tests/ "https://thepracticaldeveloper.com/guide-spring-boot-controller-tests/")
  1. Spring boot, mockito and junit -- unit test service layer https://howtodoinjava.com/spring-boot2/testing/spring-boot-mockito-junit-example/
复制代码
## Mocking with (and without) Spring Boot [https://reflectoring.io/spring-boot-mock/](https://reflectoring.io/spring-boot-mock/ "https://reflectoring.io/spring-boot-mock/")
复制代码
## PowerMock tutorial

[https://java2blog.com/powermock-tutorial/](https://java2blog.com/powermock-tutorial/ "https://java2blog.com/powermock-tutorial/")
  1. Using Powermock with Mockito(PowerMockito)
    https://medium.com/xebia-engineering/using-powermock-with-mockito-powermockito-bd02cd72cb9c

  2. mockito powermock https://www.javatpoint.com/mockito-powermock
复制代码
### PowerMock Part 2 [https://blog.jayway.com/2009/05/01/powermock-part-2/](https://blog.jayway.com/2009/05/01/powermock-part-2/ "https://blog.jayway.com/2009/05/01/powermock-part-2/")
复制代码
## PowerMock學習(三)之Mock區域性變數 [https://www.itread01.com/content/1574269502.html](https://www.itread01.com/content/1574269502.html "https://www.itread01.com/content/1574269502.html")
复制代码
## JUnit Testing using Mockito and Power Mock - SpringBoot \| JavaTechie [https://www.youtube.com/watch?v=WBZHm4UlPPE](https://www.youtube.com/watch?v=WBZHm4UlPPE "https://www.youtube.com/watch?v=WBZHm4UlPPE")
复制代码
## Simplifying Junit, Mockito And PowerMock

[https://aggarwal-rohan17.medium.com/simplifying-junit-mockito-and-powermock-d1392059ce87](https://aggarwal-rohan17.medium.com/simplifying-junit-mockito-and-powermock-d1392059ce87 "https://aggarwal-rohan17.medium.com/simplifying-junit-mockito-and-powermock-d1392059ce87")
复制代码
## [JUnit Testing using Mockito and PowerMock](https://blog.codecentric.de/en/2016/03/junit-testing-using-mockito-powermock/ "JUnit Testing using Mockito and PowerMock") [https://blog.codecentric.de/en/2016/03/junit-testing-using-mockito-powermock/](https://blog.codecentric.de/en/2016/03/junit-testing-using-mockito-powermock/ "https://blog.codecentric.de/en/2016/03/junit-testing-using-mockito-powermock/")
复制代码
### [Java - How to integrate Spring with PowerMock?](https://www.davisfiore.co.uk/?q=node/285 "Java - How to integrate Spring with PowerMock?") [https://www.davisfiore.co.uk/?q=node/285](https://www.davisfiore.co.uk/?q=node/285 "https://www.davisfiore.co.uk/?q=node/285")
复制代码
## Mockito - Unit Testing FacesContext using PowerMock, JUnit and Maven [https://codenotfound.com/mockito-unit-testing-facescontext-powermock-junit.html](https://codenotfound.com/mockito-unit-testing-facescontext-powermock-junit.html "https://codenotfound.com/mockito-unit-testing-facescontext-powermock-junit.html")
相关推荐
7ioik23 分钟前
什么是线程池?线程池的作用?线程池的四种创建方法?
java·开发语言·spring
切糕师学AI23 分钟前
Lombok 注解 @Slf4j
java·lombok
寻星探路26 分钟前
JavaSE重点总结后篇
java·开发语言·算法
EAIReport30 分钟前
自动化报告生成产品内嵌OA/BI平台:解决传统报告痛点的技术方案
java·jvm·自动化
狮子座的男孩2 小时前
js基础高级:01、数据类型(typeof、instanceof、===的使用)、数据与变量与内存(定义、赋值与内存关系、引用变量赋值、js调函数传参)
前端·javascript·经验分享·数据类型·数据与变量与内存·赋值与内存关系·引用变量赋值
向着光芒的女孩6 小时前
【IDEA】关不了的Proxy Authentication弹框探索过程
java·ide·intellij-idea
Filotimo_7 小时前
Spring Boot 整合 JdbcTemplate(持久层)
java·spring boot·后端
李慕婉学姐7 小时前
【开题答辩过程】以《“饭否”食材搭配指南小程序的设计与实现》为例,不知道这个选题怎么做的,不知道这个选题怎么开题答辩的可以进来看看
java·spring·小程序
go_bai8 小时前
Linux-线程2
linux·c++·经验分享·笔记·学习方法
abments8 小时前
pgsql timestamp without time zone > character varying解决方案
java