We may earn an affiliate commission when you visit our partners.
Course image
Udemy logo

Testing Spring Boot

Beginner to Guru

John Thompson • 500,000+ Enrollments Worldwide and Spring Ahead Code Academy

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.

Read 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.

Not sure what a mock is? It's effectively a test double. An object created for unit testing.

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 Mockito to mock dependent objects in your unit tests.

The first 11 sections of the course focus heavily on unit testing with JUnit 5 and Mockito. This is to help you establish a strong unit testing foundation before we start testing Spring Boot applications.

You will have no doubts when it comes to testing Java classes using JUnit 5 and Mockito.

The Spring Framework itself has some very robust testing capabilities.

We start learning to test the Spring Framework by adding the Spring Framework Testing context to our tests.

This allows us to leverage the Spring Framework's Dependency Injection capabilities right in our tests.

Properly testing Spring MVC controllers can always be a little tricky. You need to test all the things you are expecting the Spring Framework to handle for you around calls to your controllers.

This is where Spring MVC Test steps in. You will see how you can use Spring MVC Test with JUnit 5 and Mockito to properly test your Spring MVC Controllers.

The course continues showing you how to use Spring Boot test splices to bring up a minimal Spring Boot configuration for the testing of a Spring MVC RESTful controller.

Another powerful Spring project is Spring This is a project which allows you to generate API documentation from your Spring Mock MVC tests.

Inside this course you will learn:

  • JUnit 5

  • AssertJ

  • Hamcrest Matchers

  • Mockito 2

  • Test Driven Development (TDD)

  • Behavior Driven Development (BDD) with Mockito

  • Migrating to JUnit 5 from JUnit 4

  • Running JUnit 5 tests from Maven

  • Running JUnit 5 tests from Gradle

  • Use CircleCI with Maven for Continuous Integration Testing

  • Spring MVC Test

  • JsonPath

  • Wiremock

  • Spring Get hands on experience using the Java IDE preferred by Spring Framework professionals.  

    Course Extra - Access to a Private Slack Community

    You're not just enrolling in a course > You are joining a community learning about testing Spring.

    With your enrollment to the course, you can access an exclusive Slack community. Get help from the instructor and other Spring Framework Gurus from around the world - in real time. This community is only available to students enrolled in this course. 

    This is a very active Slack community with over 1,000 Spring Framework Gurus.

    This is the largest online community of people learning Spring in the world.

    With your enrollment, you can join this community of awesome gurus.

    Source Code Access

    All course source code is available in GitHub. When you enroll, refer to the lesson resources for links to GitHub.

    Closed Captioning / Subtitles

    Closed captioning in English is available for all course videos.

    PDF Downloads

    All keynote presentations are available for you to download as PDFs.

    Lifetime Access

    When you purchase this course, you will receive lifetime access. You can login anytime from anywhere to access the course content.

    No Risk - Money Back Guarantee 

    You can buy this course with no risk. If you are unhappy with the course, for any reason, you can get a complete refund. The course has a 30 day Money Back Guarantee.Enroll today and start learning about the latest tools and best practices for testing your Spring Boot applications.  

Enroll now

What's inside

Learning objectives

  • 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

Syllabus

Introduction

Meet your instructor John Thompson, founder of Spring Framework Guru, Speaker at Spring One, former Spring Source consultant

Read more

Welcome to the Testing Spring Boot course!

Getting the Most out of your Testing Spring Boot Course
Is Your IDE Free Like a Puppy?
IntelliJ 120 Day Trial
Slack Community Exclusive to Testing Spring Boot Course!
GitHub Workflow
Introduction to Testing Software

Introduction to testing software.

See a very simple JUnit 5 unit test.

Overview of common testing frameworks for Java and Spring Boot. Includes: JUnit 4, JUnit 5, TestNG, Spock, Mockito, Selenium, and GEB.

Learn why having proper test coverage via JUnit tests is needed to realize the benefits of CI/CD for your Spring Boot applications.

Conclusion
Learn about Test Driven Development with JUnit 5

Section overview for learning Test Driven Development using JUnit 5.

Learn about the original author of JUnit, Kent Beck, and his passion for Test Driven Development.

In this lesson, we review the development requirements for completing the TDD section of the course using JUnit 5.

Multi-Currency Money
Degenerate Objects
Equality for All
Privacy
Franc-ly Speaking
Equality for All, Redux
Apples and Oranges
Makin' Objects
Times We're Livin' In
Interesting Times
The Root of All Evil
Addition, Finally
Make It
Change
Mixed Currencies
Abstraction, Finally
Viewing Test Coverage from IntelliJ
Learn the basics of JUnit 5 which is the standard testing framework of Spring Boot 2.2

Overview of the Getting Started with JUnit 5 section of the course.

Overview of JUnit 5.

How to add the required dependencies for JUnit 5 to your Maven POM.

Simple "Hello World" example in JUnit 5.

See how to initialize properties using the JUnit @Before annotation.

JUnit 5 Test Instance Lifecycle Demo
Running JUnit 5 Tests from Command Line with Maven
JUnit Gradle Project Setup
Running JUnit 5 Tests from Command Line with Gradle
Conclusion of Getting Started with JUnit 5
Learn about testing your Java code using JUnit 5

Introduction to this section of the course, which is an introduction to JUnit 5.

In this lesson we review the code of a project we will use to write tests using JUnit 5.

Overview of JUnit Assertions
JUnit Assertions
JUnit Grouped Assertions
JUnit Dependent Assertions
Skipping JUnit Tests
JUnit Test Display Names
Testing Expected Exceptions
Testing Timeouts
JUnit Assumptions
Conditional JUnit Test Execution
Using AssertJ with JUnit
Using Hamcrest with JUnit
Assignment - Write JUnit Test for Vet Controller List Vets
Assignment Review - Write JUnit Test for Vet Controller List Vets
Advanced JUnit Testing

Introduction to the section of the course on advanced features of JUnit 5.

Learn how you can tag and filter JUnit tests.

Learn how to use JUnit nested tests.

JUnit 5 brings the capability to use Java interfaces for your unit tests

You can use Java default methods with your JUnit 5 tests.

See how to repeat JUnit tests multiple times.

JUnit 5 has the ability to inject dependencies into your tests.

Student assignment covering JUnit dependency injection.

Review of student assignment covering JUnit dependency injection.

JUnit Parameterized Tests - Value Source
JUnit Parameterized Test - Display Name
JUnit Parameterized Tests - ENUM Source
JUnit Parameterized Tests - CSV Source
JUnit Parameterized Tests - CSV File Source
JUnit Parameterized Tests - Method Provider
JUnit Parameterized Tests - Custom Provider
Unit Tests vs Integration Tests
JUnit Extensions
Test Execution
Running Tests from IDE
Maven Surefire Plugin
Maven Failsafe Plugin
Maven SurefireTest Reporting
Executing JUnit Test with Tags in Maven
Running Tests from CI Builds With Maven
CircleCI Build Badge
Gradle Project Overview
Running JUnit Tests from Gradle
Integration Tests With Gradle
Gradle JUnit Test Reports

Good to know

Know what's good
, what to watch for
, and possible dealbreakers
Outlines the importance of TDD for software development teams
Covers essential Java testing tools like JUnit, AssertJ, and Mockito
Provides hands-on demonstrations using IntelliJ IDEA, the preferred IDE for Java developers
Focuses on migrating JUnit 4 tests to JUnit 5 for improved testing capabilities
Offers real-world examples and exercises for a practical understanding of testing Java classes and Spring Boot applications
Emphasizes testing all layers of an application, from unit to integration to RESTful services

Save this course

Save Testing Spring Boot: Beginner to Guru to your list so you can find it easily later:
Save

Reviews summary

Passing tips for spring boot tests

According to students, this course is pretty good and contains passing tips for Spring Boot tests. However, learners say that sometimes the text is too small.
Provides useful tips.
"Pretty good course, but sometimes the text is too small."
Text is sometimes too small.
"Pretty good course, but sometimes the text is too small."

Activities

Coming soon We're preparing activities for Testing Spring Boot: Beginner to Guru. These are activities you can do either before, during, or after a course.

Career center

Learners who complete Testing Spring Boot: Beginner to Guru will develop knowledge and skills that may be useful to these careers:
Software Test Engineer
Software Test Engineers are responsible for testing software applications to ensure they meet the requirements and quality standards. This course can help you become a Software Test Engineer by providing you with a solid foundation in testing principles and practices. You will learn how to write test cases, execute tests, and analyze results. You will also learn about different types of testing, such as unit testing, integration testing, and functional testing.
Quality Assurance Analyst
Quality Assurance Analysts are responsible for ensuring the quality of software products. This course can help you become a Quality Assurance Analyst by providing you with a comprehensive understanding of software testing and quality assurance principles. You will learn how to develop and implement quality assurance plans, conduct audits, and analyze test results.
Test Automation Engineer
Test Automation Engineers are responsible for automating software testing processes. This course can help you become a Test Automation Engineer by providing you with the skills and knowledge you need to develop and implement automated test scripts. You will learn about different test automation tools and techniques, and how to integrate them into your testing process.
Software Developer
Software Developers are responsible for designing, developing, and testing software applications. This course can help you become a Software Developer by providing you with a strong foundation in software development principles and practices. You will learn how to write code, debug code, and test code. You will also learn about different software development tools and technologies.
Data Scientist
Data Scientists are responsible for collecting, analyzing, and interpreting data. This course can help you become a Data Scientist by providing you with a strong foundation in data science principles and practices. You will learn how to use data analysis tools and techniques to extract insights from data. You will also learn how to communicate your findings to stakeholders.
Business Analyst
Business Analysts are responsible for analyzing business needs and developing solutions to meet those needs. This course can help you become a Business Analyst by providing you with a strong foundation in business analysis principles and practices. You will learn how to gather requirements, analyze data, and develop solutions.
Project Manager
Project Managers are responsible for planning, executing, and controlling projects. This course can help you become a Project Manager by providing you with a strong foundation in project management principles and practices. You will learn how to develop project plans, manage budgets, and track progress.
Product Manager
Product Managers are responsible for defining, developing, and launching products. This course can help you become a Product Manager by providing you with a strong foundation in product management principles and practices. You will learn how to conduct market research, develop product roadmaps, and manage product launches.
UX Designer
UX Designers are responsible for designing the user experience of products. This course can help you become a UX Designer by providing you with a strong foundation in UX design principles and practices. You will learn how to conduct user research, create prototypes, and design user interfaces.
UI Designer
UI Designers are responsible for designing the visual appearance of products. This course can help you become a UI Designer by providing you with a strong foundation in UI design principles and practices. You will learn how to create mockups, develop style guides, and design user interfaces.
Front-End Developer
Front-End Developers are responsible for developing the front-end of websites and applications. This course can help you become a Front-End Developer by providing you with a strong foundation in front-end development principles and practices. You will learn how to write HTML, CSS, and JavaScript.
Back-End Developer
Back-End Developers are responsible for developing the back-end of websites and applications. This course can help you become a Back-End Developer by providing you with a strong foundation in back-end development principles and practices. You will learn how to write code that interacts with databases, servers, and other systems.
Full-Stack Developer
Full-Stack Developers are responsible for developing both the front-end and back-end of websites and applications. This course can help you become a Full-Stack Developer by providing you with a strong foundation in both front-end and back-end development principles and practices.
DevOps Engineer
DevOps Engineers are responsible for bridging the gap between development and operations. This course can help you become a DevOps Engineer by providing you with a strong foundation in DevOps principles and practices. You will learn how to automate build, test, and deployment processes.
Cloud Engineer
Cloud Engineers are responsible for designing, deploying, and managing cloud infrastructure. This course may be useful if you are interested in becoming a Cloud Engineer, as it can help you build a foundation in cloud computing principles and practices. You will learn about different cloud platforms, such as AWS, Azure, and Google Cloud, and how to use them to build and deploy applications.

Reading list

We've selected ten books that we think will supplement your learning. Use these to develop background knowledge, enrich your coursework, and gain a deeper understanding of the topics covered in Testing Spring Boot: Beginner to Guru.
Classic guide to test-driven development (TDD). It provides a step-by-step guide to writing tests that will help you to design and build better software.
Provides a comprehensive overview of unit testing, including its principles, patterns, and best practices. It valuable resource for anyone who wants to improve their unit testing skills.
Provides a comprehensive guide to writing effective Java code. It covers a wide range of topics, including coding conventions, design patterns, and performance optimization.
Provides a fun and engaging introduction to Java. It great resource for anyone who is new to Java or who wants to learn more about it.
Provides a comprehensive reference for Java. It covers a wide range of topics, including the Java language, the Java APIs, and the Java development environment.
Provides a comprehensive overview of the Spring Framework. It covers a wide range of topics, including the core Spring modules, Spring MVC, and Spring Boot.
Provides a comprehensive guide to Spring Boot 2. It covers a wide range of topics, including Spring Boot fundamentals, Spring Boot for web development, and Spring Boot for cloud development.
Provides a comprehensive guide to Spring MVC. It covers a wide range of topics, including the Spring MVC architecture, Spring MVC controllers, and Spring MVC views.
Provides a comprehensive guide to continuous delivery. It covers a wide range of topics, including CI/CD pipelines, test automation, and deployment automation.
Provides a comprehensive guide to software release management. It covers a wide range of topics, including release planning, release execution, and release monitoring.

Share

Help others find this course page by sharing it with your friends and followers:

Similar courses

Here are nine courses similar to Testing Spring Boot: Beginner to Guru.
JUnit and Mockito Crash Course
Most relevant
Testing Spring Boot App with JUnit, Mockito &...
Most relevant
Unit Testing in Spring Framework 6 with JUnit
Most relevant
Java Spring Boot Application Software Testing
Most relevant
Spring Framework 5: Beginner to Guru
Most relevant
Guía Completa JUnit y Mockito incluye Spring Boot Test
Most relevant
JUnit 5 Fundamentals
Most relevant
Getting Started Unit Testing with JUnit 5
Most relevant
TDD using Spring 6 and JUnit
Most relevant
Our mission

OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.

Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.

Find this site helpful? Tell a friend about us.

Affiliate disclosure

We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.

Your purchases help us maintain our catalog and keep our servers humming without ads.

Thank you for supporting OpenCourser.

© 2016 - 2024 OpenCourser