Skip to content

mtkhawaja/testing-cookbook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Testing Cookbook

CI Java 25 Maven 4

A collection of small, focused examples for common testing scenarios in Java and Spring Boot.

The goal: show a minimal implementation for each testing approach, including the trade-offs, and provide copy/paste-friendly starting points.

Prerequisites

Suggestion: Use sdkman to configure java and maven versions.

Quickstart

#!/usr/bin/env bash

./mvnw clean install

What’s inside

This repo is organized as a multi-project Maven project:

  • modules/auto-configuration — Testing custom auto-configuration classes / custom spring starters using ApplicationContextRunner
  • modules/bdd — Behavior Driven Development (BDD) tests with Spring, Cucumber, Jupiter, and multiple @CucumberContextConfiguration
  • modules/containers — Integration tests with real services via Testcontainers
  • modules/embedded-db — In-memory DB testing patterns (e.g., H2, Derby, HSQLDB)
  • modules/embedded-kafka — Messaging tests with embedded Kafka
  • modules/localstack — AWS integration-style tests locally with LocalStack and Test Containers
  • modules/web — HTTP Layer tests via: Mockito, @WebMvcTest, RestTestClient, and TestRestTemplate.

References

Releases

No releases published

Packages

No packages published