![Master Java Unit Testing with Spring Boot and Mockito [Video]](https://content.packt.com/V11310/cover_image_small.jpg)
Master Java Unit Testing with Spring Boot and Mockito [Video]
Subscription
FREE
Video + Subscription
$29.99
Video
$118.99
What do you get with a Packt Subscription?
What do you get with a Packt Subscription?
What do you get with Video + Subscription?
What do you get with a Packt Subscription?
What do you get with eBook?
What do I get with Print?
What do I get with Print?
What do you get with video?
What do you get with Audiobook?
Subscription
FREE
Video + Subscription
$29.99
Video
$118.99
What do you get with a Packt Subscription?
What do you get with a Packt Subscription?
What do you get with Video + Subscription?
What do you get with a Packt Subscription?
What do you get with eBook?
What do I get with Print?
What do I get with Print?
What do you get with video?
What do you get with Audiobook?
-
Free ChapterIntroduction
-
Mocking with Mockito
- Step 00 - Section Introduction - Mocking with Mockito
- Step 01 - Setting Up the Project Using Spring Initializr
- Step 02 - Writing a Unit Test for a Simple Business Service
- Step 03 - Setting Up a Business Service to call a Data Service
- Step 04 - Writing Your First Unit Test with Stub
- Step 05 - Exercise Solution - Updating Tests 2 and 3 to Use Stub
- Step 06 - Writing Unit Tests with Mocking Using Mockito
- Step 07 - Exercise Solution - Updating Tests 2 and 3 to Use Mockito
- Step 08 - More Refactoring - @Mock, @InjectMocks, and @RunWith(MockitoJUnitRunner)
- Step 09 - Mockito Tips - Multiple Return Values and Specific Argument Matchers
- Step 10 - Mockito Tips - Argument Matchers
- Step 11 - Mockito Tips - Verify Method Calls
- Step 12 - Mockito Tips - Argument Capture
- Step 13 - Mockito Tips - Argument Capture on Multiple Calls
- Step 14 - Introduction to Spy
- Step 15 - Mockito FAQs
-
Unit Testing with Spring Boot and Mockito
- Step 00 - Section Introduction - Unit Testing with Spring Boot and Mockito
- Step 01 - Creating a Hello World Controller
- Step 02 - Using MockMvc to Test the Hello World Controller
- Step 03 - Using Response Matchers to Check Status and Content
- Step 04 - Creating a Basic REST Service in Item Controller
- Step 05 - Unit Testing Item Controller and Basic JSON Assertions
- Step 06 - Digging Deeper into JSONassert
- Step 07 - Writing a REST Service talking to Business Layer
- Step 08 - Writing Unit Test for REST Service Mocking Business Layer
- Step 09 - 00 - Overview of Steps 09 to 15
- Step 09 - 01 - Prepare Data Layers with JPA, Hibernate, and H2
- Step 10 - Create Item Entity and Populate Data with data.sql
- Step 11 - Create a RESTful Service Talking to the Database
- Step 12 - Writing Unit Test for Web Layer - Controller - Using MockMvc
- Step 13 - Exercise and Solution - Writing Unit Test for Business Layer ? Mocking
- Step 14 - Writing Unit Test for Data Layer - Data JPA Test
- Step 15 - Writing an Integration Test Using @SpringBootTest
- Step 16 - Tip - Using @MockBean to Mock Out Dependencies that are Not Required
- Step 17 - Tip - Creating Different Test Configuration
- Step 18 - Writing Unit Tests for Other Request Methods
- Step 19 - Refactor SomeBusinessImpl to Use Functional Programming
- Step 20 - Better Assertions with Hamcrest ? HamcrestMatcherTest
- Step 21 - Better Assertions with AssertJ ? AssertJTest
- Step 22 - Better Assertions with JSONPath ? JSONPathTest
- Step 23 - Tip Patterns ? xunitpatterns
- Step 24 - Tip - Measuring Test Coverage with Eclipse
- Step 25 - Tip - Keep an Eye on Performance of Unit Tests!
- Step 26 - Good Unit Tests
-
Congratulations
About this video
Spring Boot is the most popular framework to develop RESTful services. It has awesome unit testing capabilities through the Spring Boot Starter Test. Mockito is the most popular mocking framework. JUnit is the most popular Java unit testing framework. You will build the unit tests step by step (in 40 easy steps).
This course would be a perfect first step as an introduction to unit testing with the Spring Boot and Mockito frameworks. You will be using Spring (dependency management), Spring Boot, Maven (dependency management), Eclipse (IDE), in-memory database H2 and Tomcat embedded web server. We will help you set up each one of these. You will use all the frameworks that are part of the Spring Boot Starter Test: JUnit, Spring Test, Spring Boot Test, AssertJ, Hamcrest, Mockito, JSONassert, and JSONPath. You will also learn how to use the most important unit testing annotations: @RunWith(SpringRunner.class), @SpringBootTest, @WebMvcTest, @DataJpaTest, and @MockBean.
By the end of this course, you will be able to write awesome unit tests for your RESTful services.
The code files and resource files are uploaded on the GitHub repository at https://github.com/packtpublishing/master-java-unit-testing-with-spring-boot-and-mockito
- Publication date:
- May 2018
- Publisher
- Packt
- Duration
- 3 hours 55 minutes
- ISBN
- 9781789346077
Latest Reviews
(1 reviews total)