NOTE: This article is an updated version of Elasticsearch real integration tests
Integration tests… How do you run them?
Often, you are tempted to run services you want to test from JUnit for example.
In elasticsearch, you can extend ESIntegTestCase
class which will start a cluster of a given
number of nodes.
1 2 3 4 5 |
|
But to be honest, the test you are running does not guarantee that you will have the same result in production.
Why this? Because some services might be disabled, some others might be mocked.
Instead, running tests against a real cluster as the one you would install locally on your machine is the way to go.
Let’s see how you can do that with Maven…