0Pricing
Testing Mastery: JUnit, Mockito & Integration Tests · Lesson

Testing External APIs with WireMock

Integration-test code that calls external HTTP services by stubbing those services with WireMock instead of hitting the network.

The External Dependency Problem

Integration tests often touch real collaborators, but calling a live third-party API is slow, flaky, and may cost money. WireMock runs a local HTTP server you can program to mimic that API.

What WireMock Provides

WireMock lets you:

  • Stub HTTP responses for specific requests
  • Simulate delays, errors, and edge cases
  • Verify that your code made the expected calls

All lessons in this course

  1. Unit vs. Integration Tests
  2. Setting Up Integration Tests
  3. Testing Database Interactions
  4. Testing External APIs with WireMock
← Back to Testing Mastery: JUnit, Mockito & Integration Tests