Spring boot 2 with Junit 5 and Mockito 2 for unit testing and integration test

Mahmoud Romeh
Sep 6, 2018 · 1 min read

Here we will explain to use Junit 5 and Mockito 2 with Spring boot 2 when it comes to unit testing and integration tests .

First if you are interested to read more about Junit 5 and Mockito 2 , please check the following links :

  1. Junit 5: https://junit.org/junit5/
  2. Mockito 2 : https://github.com/mockito/mockito/wiki/What%27s-new-in-Mockito-2

Here we will show to the following :

  1. Gradle configuration for Junit 5 with spring boot 2
  2. How to define and execute unit test with Junit 5 and mockito 2
  3. How to define and execute spring boot integration test with Junit 5

The whole details of the above points covered in my blog post : https://mromeh.com/2018/09/05/spring-boot-2-with-junit-5-and-mockito-2-for-unit-testing-and-integration-test/

Mahmoud Romeh
Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade