Daniel Raniz Raneland
Three-and-a-half Ways of Testing your Repositories
#1about 5 minutes
Introduction to repositories in domain-driven design
Repositories act as an abstraction layer between the domain and infrastructure, separating business logic from data persistence concerns.
#2about 9 minutes
Mocking the client API for fast and isolated tests
The first method involves replacing the backend client, like an S3 client, with a mock object to verify that the correct methods are called.
#3about 8 minutes
Mocking the backend service for client-agnostic tests
Instead of mocking the client library, you can intercept and mock the HTTP requests it makes to the backend service, like DynamoDB.
#4about 3 minutes
The brittleness of mocking SQL statements directly
Asserting on exact SQL strings is a fragile approach because minor refactoring, like adding parameters, will break the tests.
#5about 6 minutes
Testing against a real, persistent database service
Using a shared development or staging database provides a realistic environment but introduces significant challenges with state management and cleanup.
#6about 7 minutes
Using temporary services with Testcontainers for reliable tests
Testcontainers allows you to programmatically spin up ephemeral database instances in Docker, enabling realistic and isolated roundtrip testing.
#7about 4 minutes
Comparing the pros and cons of each testing method
A final summary compares the speed, complexity, and implementation coupling of client mocking, service mocking, and testing against real or temporary services.
#8about 15 minutes
Q&A on testing strategies and CI/CD integration
The Q&A covers choosing mocking frameworks, balancing unit and integration tests, handling data migrations, and integrating repository tests into CI/CD pipelines.
Related jobs
Jobs that call for the skills explored in this talk.
Eltemate
Amsterdam, Netherlands
Intermediate
Senior
TypeScript
Continuous Integration
+1
Matching moments
01:32 MIN
Organizing a developer conference for 15,000 attendees
Cat Herding with Lions and Tigers - Christian Heilmann
04:57 MIN
Increasing the value of talk recordings post-event
Cat Herding with Lions and Tigers - Christian Heilmann
02:54 MIN
Automating video post-production with local scripts
Cat Herding with Lions and Tigers - Christian Heilmann
02:39 MIN
Establishing a single source of truth for all data
Cat Herding with Lions and Tigers - Christian Heilmann
04:49 MIN
Using content channels to build an event community
Cat Herding with Lions and Tigers - Christian Heilmann
04:57 MIN
Developing resilience by expanding your capacity for failure
What 2025 Taught Us: A Year-End Special with Hung Lee
04:22 MIN
Why HR struggles with technology implementation and adoption
What 2025 Taught Us: A Year-End Special with Hung Lee
03:28 MIN
Why corporate AI adoption lags behind the hype
What 2025 Taught Us: A Year-End Special with Hung Lee
Featured Partners
Related Videos
Write tests you love, not hate
Jens Happe
Test-Driven Development: It's easier than you think!
Eric Deandrea
TDD for Vue.js Developers
Markus Oberlehner
How not to test
Golo Roden
Building Reliable Serverless Applications with AWS CDK and Testing
Raphael Manke
Why you must use TDD now!
Alex Banul
Contract Testing - How do you tame an external API that constantly breaks your tests
Vincent Hennig & Anupam Krishnamurthy
Continuous testing - run automated tests for every change!
Christian Kühn
Related Articles
View all articles



From learning to earning
Jobs that call for the skills explored in this talk.


Test Driven Solutions Ltd
Newcastle upon Tyne, United Kingdom
Remote
Intermediate
DevOps
Python
Gitlab
Splunk
+14

Test Driven Solutions
Edinburgh, United Kingdom
Intermediate
Java
MySQL
NoSQL
Scrum
Jenkins
+4


GitLab
Bristol, United Kingdom
£131-282K
API
C++
Gitlab
Burp Suite
+1

GitLab
Glasgow, United Kingdom
£131-282K
API
C++
Gitlab
Burp Suite
+1


GitLab
Sheffield, United Kingdom
£131-282K
API
C++
Gitlab
Burp Suite
+1

Clickhouse Cloud
Redruth, United Kingdom
Remote
Senior
Go
C++
GIT
Linux
+1