WireMock JUnit 4 Test Setup For Integration Tests

Опубликовано: 21 Март 2026
на канале: Philip Riecks
2,459
23

YouTube series explaining how to use WireMock for mocking the HTTP communication to external systems for integration tests.

This third video covers the JUnit 4 test setup for WireMock and uses WireMock's JUnit 4 ClassRule for this purpose.

While the sample application uses Spring Boot, you can use this testing recipe for any Java application.

Content:

0:00​ Test Setup Introduction
02:10 Introduce the WireMockClassRule
06:10 Resetting the Stub Mappings
07:20 Summary And Recap

Part I:    • WireMock Introduction and Basic Integratio...  
Part II:    • WireMock Basic Feature Overview to Mock HT...  
Part III:    • WireMock JUnit 4 Test Setup For Integratio...  
Part IV:    • WireMock JUnit 5 Test Setup For Integratio...  

The source code for this video is available on GitHub: https://github.com/rieckpil/blog-tuto...

30 Testing Tools and Libraries Every Java Developer Must Know: https://rieckpil.de/testing-tools-and...

» Testing Spring Boot applications deep-dive: https://rieckpil.de/testing-spring-bo...

#WireMock #JUnit4 #ClassRule