Testcontainers for real integration tests with Elasticsearch

Testcontainers for real integration tests with Elasticsearch
How are you testing with your database?
- Mocking is not an option since you want to test the actual system.
- In-memory databases, like H2 or HSQLDB, have subtle differences and not all datastores have in-memory cousins.
- Managing and running tests in parallel against the actual datastore is a pain.
So what is the solution? There are some very neat solutions based on containers, namely the Docker-Maven-Plugin and Testcontainers. From your tests you can start a lightweight, throwaway instance of your datastore and this talk will walk you through how to do that.
And we will introduce the module we built for Elasticsearch: https://www.testcontainers.org/modules/elasticsearch/ .
Title
Testcontainers for real integration tests with ElasticsearchAbstract
How are you testing with your database?
* Mocking is not an option since you want to test the actual system.
* In-memory databases, like H2 or HSQLDB, have subtle differences and not all datastores have in-memory cousins.
* Managing and running tests in parallel against the actual datastore is a pain.
So what is the solution? There are some very neat solutions based on containers, namely the Docker-Maven-Plugin and Testcontainers. From your tests you can start a lightweight, throwaway instance of your datastore and this talk will walk you through how to do that.
And we will introduce the module we built for Elasticsearch: https://www.testcontainers.org/modules/elasticsearch/.
Testcontainers pour de vrais tests d'intégration d'Elasticsearch
Les tests d’intégration peuvent devenir un cauchemar lorsqu’ils sont lancés depuis la même JVM que votre code:
- Conflit de JARs (JAR Hell)
- Security Manager
- Effets de bord
De plus, tester avec un produit qui est lancé de façon différente de la façon dont il est lancé en production, ne garantira jamais que les tests d’intégration sont sincères.
Aussi, après avoir découvert le projet Testcontainers qui lance des conteneurs Docker, j’ai décidé d’écrire une implémentation pour Elasticsearch: testcontainers-java-module-elasticsearch . Je vous propose de découvrir tout cela pendant cette session.
Title
Testcontainers pour de vrais tests d'intégration d'ElasticsearchAbstract
Les tests d'intégration peuvent devenir un cauchemar lorsqu'ils sont lancés depuis la même JVM que votre code:
* Conflit de JARs (JAR Hell)
* Security Manager
* Effets de bord
De plus, tester avec un produit qui est lancé de façon différente de la façon dont il est lancé en production, ne garantira jamais que les tests d'intégration sont sincères.
Aussi, après avoir découvert le projet [Testcontainers](https://www.testcontainers.org/) qui lance des conteneurs Docker, j'ai décidé d'écrire une implémentation pour Elasticsearch: [testcontainers-java-module-elasticsearch](https://www.testcontainers.org/modules/elasticsearch/).
Je vous propose de découvrir tout cela pendant cette session.
Resources
Useful resources related to this talk.
Demo: Elasticsearch Integration Tests
This demo shows how you can test your Elasticsearch integration with Testcontainers.
Repository: Elasticsearch Module for TestContainers
This repository contains the code for the Elasticsearch Module for TestContainers.
Documentation: Elasticsearch TestContainers module
This documentation contains the information about the Elasticsearch TestContainers module.
