Training Agenda

JUnit 5 &
Integration Testing

JUnit 5 is the foundation of the Java testing ecosystem — and most teams use 20% of its capabilities. Beyond basic @Test, JUnit 5 provides parameterized tests, extensions, dynamic tests, and a clean lifecycle model. Combined with Spring Boot's test slices, Testcontainers for real infrastructure, and AssertJ for readable assertions, it enables a testing strategy that actually catches production bugs without becoming a maintenance burden.

1 day On-site, remote, or hybrid Up to 20 participants German or English
What We Cover
From unit tests to real infrastructure — the full Java testing stack
Module 1

JUnit 5 & Mockito

  • JUnit 5 architecture: Platform, Jupiter, Vintage
  • @Test, @BeforeEach, @AfterEach, @BeforeAll, @AfterAll — lifecycle methods
  • @ParameterizedTest: @ValueSource, @CsvSource, @MethodSource, @EnumSource
  • @RepeatedTest and @DynamicTest: factory-based test generation
  • Nested tests: @Nested for organizing test classes
  • JUnit 5 extensions: @ExtendWith, custom extensions, MockitoExtension
  • AssertJ: fluent assertions — assertThat(), soft assertions, custom assertions
  • Mockito: @Mock, @InjectMocks, when/thenReturn, verify, ArgumentCaptor
  • Mockito strict stubbing: detecting unnecessary stubs
  • Testing exceptions: assertThrows, assertThrowsExactly
Module 2

Spring Boot Test Slices & Testcontainers

  • @SpringBootTest: full context, web environment, TestRestTemplate vs MockMvc
  • @WebMvcTest: controller slice — testing HTTP layer in isolation
  • @DataJpaTest: repository slice with in-memory H2 database
  • @MockBean vs @SpyBean: replacing beans in the context
  • Testcontainers: real PostgreSQL, Kafka, Redis in tests — no mocking
  • Testcontainers with JUnit 5: @Container, @Testcontainers
  • Reusing containers: static container lifecycle for faster test suites
  • WireMock: stubbing external HTTP dependencies
  • Integration test structure: @SpringBootTest + Testcontainers as the recommended stack
  • Test coverage: JaCoCo configuration, excluding generated code, meaningful thresholds
Learning Outcomes
What your team walks away with

Java developers who write tests that catch real bugs, run fast enough to use constantly, and don't break every time the implementation changes.

Book the JUnit 5 & Integration Testing training

A practical one-day course — works well as a follow-on to the TDD/BDD training or as a standalone testing improvement session.

Get in touch