Database Integration Testing with Testcontainers

Introduction to Testcontainers In this post we'll look at Testcontainers and how it can be used to spin up throwaway test databases for your integration tests. You'll see that Testcontainers offers an excellent alternative to in memory databases, such as H2. In memory databases have benefits in terms of speed and simplicity, but there's one fundamental drawback. Your integration tests use a database technology that is substantially different to the one your application will use in production. Testcontainers allows you to spin up the database of your choice, so that your persistence tests run against the same database technology that you'll use in production. This makes [...]

By |2021-10-27T23:29:49+01:00October 27th, 2021|Containerisation, Spring Boot, Testing|0 Comments

An Introduction to Wiremock

An Introduction to Wiremock This post provides a brief introduction to Wiremock, showing how it can be used to to quickly and easily mock remote API calls. We'll use Wiremock to write some integration tests for a simple Dropwizard app and show you how it can be put to use in a real world scenario. Why do I need to mock API calls? There are a number of scenarios where it makes sense to mock an external API rather than call a live service. The external API may still be in development and not yet available for integration. In this instance as long as a [...]

By |2019-02-18T07:10:56+00:00May 17th, 2016|Testing|0 Comments
Go to Top