Skip to content

popovski/spring-boot-integration-test-wiremock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Steps to run this project:

  1. Clone this Git repository

  2. Navigate to the folder spring-boot-integration-tests-wiremock

  3. Run mvn verify to execute the integration tests on your machine

  4. Intro to the project and WireMock

  • quick inspect of the code (uses Spring Boot, but the idea and this testing recipe can be used as an inspiration for other frameworks/setups)
  • backend API that delegates to an HTTP client to call a remote system
  • explain downsides of using the remote system during IT (depends on the uptime, additional load, create costs, modify states) with a nice-looking diagram
  • WireMock helps here as we can start a local Jetty and mock HTTP responses
  • This also helps to test error scenarios like 5xx or slow responses
  • Outline upcoming parts: more insights to WireMock, JUnit 5 and JUnit 4 setup
  • we'll start with a manual setup
  • show first simple test
  1. WireMock features
  • build on top of the existing tests
  • show request matching capability
  • explain priority of multiple requests
  • reset the request stubs after ech tests
  • request matching error in console
  • get access to the recorded requests
  1. JUnit 5 setup
  1. JUnit 4 setup
  • official rule
  • still showcase it because there a lot of projects that haven't migrated yet
  • caveats of JUnit 4 vs. JUnit 5 in the same project

About

spring-boot-integration-test-wiremock

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages