Mocks as Code. Modeling services in configuration management flows

Hands-on workshop testing infrastructure code with Testcontainers, LocalStack, WireMock and Pulumi.

Tags: testing api infrastructure-as-code configuration-management wiremock testcontainers pulumi localstack

Slides

Abstract

When managing service configurations at scale, we often need to automate testing of these configurations. In software integration testing, we can use Testcontainers - a popular framework for Docker and other container engines. For public cloud environments, there is LocalStack. And for API service providers, we have WireMock. Can we use the same toolchain for configuration management? If you use modern Infrastructure-as-Code tools like Pulumi, yes!

In this edition, we will use Java or Kotlin for EVERYTHING, from the application itself and all the way up to Infrastructure as Code definitions and tests.

In this workshop, we will go through the following topics:

  1. Containerizing Spring app development
  2. Integration testing with Testcontainers and LocalStack
  3. Mocking APIs with WireMock
  4. Infrastructure as Code (IaC) with Pulumi and Pulumi for Java
  5. Testing IaC locally, with all tools above combined

See the demo repository used in this workshop. It also contains all the links to the used tools and additional learning materials.

Gradle®, Develocity®, Build Scan®, and the Gradlephant logo are registered trademarks of Gradle, Inc. "Gradle" means "Gradle Build Tool" and does not reference Gradle, Inc. and/or its subsidiaries.

References

Presented at

  • DevOpsDays Geneva, 2024
  • PlatformCon 2025, 2025