Testing Spring Boot: Beginner to Guru

Testing Spring Boot: Beginner to Guru
Testing Spring Boot: Beginner to Guru
English | MP4 | AVC 1280×720 | AAC 44KHz 2ch | 14.5 Hours | 8.66 GB

Become an Expert Testing Java and Spring Boot Applications using JUnit 5, Mockito, Spring Boot, and More!

In modern software development having proper automated test coverage is considered a best practice. In this course you will learn how to test Java and Spring Boot applications using highly popular open source tools.

You will see in the first section of this course, the software testing ecosystem is very diverse. JUnit and Mockito are two of the leading testing libraries for Java. JUnit provides the test execution context, while Mockito give you power mocking capabilities. Together these libraries can be used to write unit tests, integration tests, and functional tests. You will also learn why having proper test coverage is critical to supporting other popular agile practices such as Continuous Integration and Continuous Deployment (aka CI/CD).

Agile teams all over the world consider Test Driven Development (TDD) a critical technique for producing quality software. This course begins by using JUnit 5 to demonstrate how to use TDD to create a simple Java application, then again using TDD to evolve the application to a higher level of quality and functionality.

Next, the course takes you into a deep dive of the features and functionality of JUnit 5. You will learn how to write JUnit 5 unit tests for a Java web application.

The primary focus of this course is on the JUnit 5 release. There are some very notable differences between JUnit 4 and JUnit 5. This course contains a dedicated section showing you how to migrate your JUnit 4 tests to JUnit 5.

As your testing needs become more complex, you will need to mock dependent objects. Mockito is the most popular mocking library used by Java developers.

If you are writing Spring Framework applications, you’re likely to be injecting dependent objects into your classes. You will learn how to use the robust mocking capabilities of Mocktio to mock dependent objects in your unit tests.

What you’ll learn

  • Learn Important Concepts behind Test Driven Development
  • Understand different types of testing – Unit, Integration, Functional
  • Master the JUnit 5 testing API
  • Easily integrate Mockito with JUnit 5 Tests
  • Migrate JUnit 4 tests to JUnit 5
  • Test Spring Framework Applications with JUnit 5 and Mockito
  • Write Unit Tests with Spring MVC Test
  • Learn to use testing features of Spring Boot
Table of Contents

1 Introduction
2 Meet Your Instructor
3 Getting the Most out of this Course
4 Is Your IDE Free Like a Puppy
5 IntelliJ 120 Day Trial
6 Slack Community

Introduction to Testing Software
7 Introduction
8 Introduction to Testing Software
9 JUnit Test Example
10 Common Testing Frameworks for Java
11 Beyond Testing with CI and CD
12 Conclusion

Test Driven Development By Example
13 Introduction
14 Apples and Oranges
15 Makin’ Objects
16 Times We’re Livin’ In
17 Interesting Times
18 The Root of All Evil
19 Addition, Finally
20 Make It
21 Change
22 Mixed Currencies
23 Abstraction, Finally
24 TDD By Example Kent Beck
25 Viewing Test Coverage from IntelliJ
26 Conclusion
27 Development Requirements and Base Project
28 Multi-Currency Money
29 Degenerate Objects
30 Equality for All
31 Privacy
32 Franc-ly Speaking
33 Equality for All, Redux

Getting Started with JUnit 5
34 Introduction to Getting Started with JUnit 5
35 Conclusion of Getting Started with JUnit 5
36 Introduction to JUnit 5
37 JUnit Maven Project Setup
38 JUnit Hello World Test
39 Initializing Properties with JUnit 5 @BeforeEach
40 JUnit 5 Test Instance Lifecycle Demo
41 Running JUnit 5 Tests from Command Line with Maven
42 JUnit Gradle Project Setup
43 Running JUnit 5 Tests from Command Line with Gradle

Testing Java with JUnit 5
44 Introduction to Testing Java with JUnit 5
45 Testing Timeouts
46 JUnit Assumptions
47 Conditional JUnit Test Execution
48 Using AssertJ with JUnit
49 Using Hamcrest with JUnit
50 Assignment – Write JUnit Test for Vet Controller List Vets
51 Assignment Review – Write JUnit Test for Vet Controller List Vets
52 Conclusion
53 Java Test Project Code Review
54 Overview of JUnit Assertions
55 JUnit Assertions
56 JUnit Grouped Assertions
57 JUnit Dependent Assertions
58 Skipping JUnit Tests
59 JUnit Test Display Names
60 Testing Expected Exceptions

Advanced JUnit Testing
61 Introduction to Advanced JUnit Testing
62 JUnit Parameterized Tests – Value Source
63 JUnit Parameterized Test – Display Name
64 JUnit Parameterized Tests – ENUM Source
65 JUnit Parameterized Tests – CSV Source
66 JUnit Parameterized Tests – CSV File Source
67 JUnit Parameterized Tests – Method Provider
68 JUnit Parameterized Tests – Custom Provider
69 Unit Tests vs Integration Tests
70 JUnit Extensions
71 Conclusion
72 Tagging and Filtering JUnit Tests
73 JUnit Nested Tests
74 JUnit Test Interfaces
75 Using JUnit Default Test Methods
76 Repeating Tests with JUnit 5
77 JUnit Test Dependency Injection
78 Assignment – JUnit Dependency Injection
79 Assignment Review

Test Execution
80 Introduction
81 Running JUnit Tests from Gradle
82 Integration Tests With Gradle
83 Gradle JUnit Test Reports
84 Conclusion
85 Running Tests from IDE
86 Maven Surefire Plugin
87 Maven Failsafe Plugin
88 Maven SurefireTest Reporting
89 Executing JUnit Test with Tags in Maven
90 Running Tests from CI Builds With Maven
91 CircleCI Build Badge
92 Gradle Project Overview

JUnit 4 to JUnit 5 Migration Guide
93 Introduction
94 JUnit 4 Example Project
95 Differences Between JUnit 4 and JUnit 5
96 JUnit 5 Maven Dependencies and Configuration
97 Converting JUnit 4 Tests to JUnit 5
98 Removing JUnit 4
99 Conclusion

Getting Started with Mockito
100 Introduction
101 Assignment Review
102 Returning values from Mockito Mocks
103 Argument Matchers
104 Assignment – Complete Tests for Visit Service
105 Assignment Review
106 Conclusion
107 Introduction to Mockito
108 Maven Dependencies for Mockito
109 Creating Mockito Mocks Inline
110 Creating Mockito Mocks with Annotations
111 JUnit Mockito Extension
112 Injecting Mocks with Mockito
113 Verify Interactions With Mockito Mocks
114 Assignment – Write Mockito Tests for Vet Service

Behavior Driven Mockito
115 Introduction
116 Introduction to Behavior Driven Development
117 BDD Mockito
118 BDD Verification in Mockito
119 Refactoring Speciality Service to BDD
120 Assignment – BDD Visit Service
121 Assignment Review
122 Conclusion

Advanced Mockito
123 Introduction
124 Verify Zero or No More Interactions with Mock
125 Using Mockito Spies
126 Conclusion
127 Throwing Exceptions with Mockito
128 Java 8 Lambda Argument Matchers
129 Assignment – Write Controller Test
130 Assignment Review
131 Mockito Argment Capture
132 Using Mockito Answers
133 Verify Order of Interactions
134 Verify Interactions within Specified Time

Testing with Spring Framework
135 Introduction
136 Overview of Spring Framework Unit Testing Features
137 Spring Pet Clinic Code Review
138 Assignment – Write Spring Unit Tests
139 Assignment Review
140 Conclusion

Spring Framework Testing Context
141 Introduction
142 Using Inner Class Configuration
143 Using Component Scans
144 Setting Active Profiles for Tests
145 Spring Test Properties
146 Assignment – Create Profile for Properties
147 Assignment Review
148 Conclusion
149 Yanny or Laurel
150 Yanny or Laurel Service Beans
151 JUnit 4 Laurel Test
152 Assignment Create Yanny JUnit 4 Test with Spring Context
153 Assignment Review Create Yanny JUnit 4 Test with Spring Context
154 JUnit 5 Laurel Test
155 Assignment Create Yanny JUnit 5 Test with Spring Context
156 Assignment Review Create Yanny JUnit 5 Test with Spring Context

Spring MVC Test
157 Introduction
158 Use Spring MVC Test For Form Post
159 Use Spring MVC Test to Test for Validation Errors
160 Assignment – Use Spring MVC Test with Form Post
161 Assignment Review
162 Conclusion
163 Spring MVC Test Overview
164 Spring Mock MVC Standalone Setup
165 Spring Web Configuration with XML
166 Assignment – Test Get Method with Spring MVC Test
167 Assignment Review
168 Using Spring MVC Test with Form Parameters
169 Assignment – Complete Tests for Find Form
170 Assignment Review

Introduction to Testing with Spring Boot
171 Introduction
172 Overview of Testing with Spring Boot
173 Default Spring Boot Test Configuration
174 Updating Spring Boot 2.x to JUnit 5
175 Assignment – Configure CircleCI
176 Assignment Review
177 Code Review of SFG Brewery Project
178 Conclusion

Spring MVC Rest Controller Tests
179 Introduction
180 Conclusion
181 Jayway JsonPath
182 Using JsonPath in MockMVC Tests
183 Using JsonPath with Lists
184 Using Custom Message Converters with Spring MVC Test
185 @WebMVC Test Splice
186 Using Test RestTemplate
187 Assignment – Write Spring MVC Tests for Get Orders
188 Assignment Review