Skip to content

PragmaTech-GmbH/digdir-workshop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Testing Spring Boot Applications Demystified Workshop

Open in GitHub Codespaces

A two-day workshop to help developers become more confident and productive when implementing automated tests for Spring Boot applications.

Proudly presented by PragmaTech GmbH.

Workshop Overview

This workshop is designed to demystify testing in Spring Boot applications through hands-on exercises, covering everything from basic unit testing to advanced integration testing techniques, test optimization, and CI/CD best practices.

The workshop is divided into eight lab sessions across two days, each focusing on different aspects of testing Spring Boot applications.

Day One: Testing Spring Boot Applications Demystified

Goal: Getting started with testing Spring Boot applications and learning how to write tests for Spring Boot applications.

Time Session
09:00 - 10:30 Block 1: Lab 1 - Workshop Introduction, Testing Basics & Unit Testing
10:30 - 11:00 Coffee Break & Exercises
11:00 - 12:30 Block 2: Lab 2 - Sliced Testing: Verifying the Web Layer
12:30 - 13:30 Lunch Break
13:30 - 15:00 Block 3: Lab 3 - Sliced Testing: Persistence Layer & Testcontainers
15:00 - 15:30 Coffee Break & Exercises
15:30 - 17:00 Block 4: Lab 4 - Integration Testing Introduction

Day Two: The Need for Speed: Optimizing Spring Boot Test Suites

Goal: Showcase and explain strategies to improve build times and speed up tests to gather fast feedback.

Time Session
09:00 - 10:30 Block 1: Lab 5 - Integration Testing Continued - Verify the Entire Application
10:30 - 11:00 Coffee Break & Exercises
11:00 - 12:30 Block 2: Lab 6 - Understanding Spring TestContext Context Caching for fast Tests
12:30 - 13:30 Lunch Break
13:30 - 15:00 Block 3: Lab 7 - Strategies for Fast and Reproducible Spring Boot Test Suites
15:00 - 15:30 Coffee Break & Exercises
15:30 - 17:00 Block 4: Lab 8 - General Spring Boot Testing Tips & Tricks and Q&A

Lab Structure

Each lab in labs/ (lab-1 through lab-8) includes:

  • Exercise files with instructions and TODO comments
  • Solution files that show the complete implementation
  • Supporting code and configurations

Prerequisites

  • Java 21 (or later)
  • Maven 3.9+ (wrapper included)
  • Docker (for Testcontainers)
  • Your favorite IDE (IntelliJ IDEA, Eclipse, VS Code, etc.)

Getting Started

  1. Clone this repository
  2. Import the projects into your IDE of choice.
  3. Run all builds with:
./mvnw verify

Slides

You'll find the slides for each lab in the slides/ directory. They are organized by lab and can be used as a reference during the workshop.

Additional Resources

About

Testing Spring Boot Applications Workshop @ Digdir

Resources

Stars

Watchers

Forks

Contributors

Languages