datastax / cassandra-quarkus

An Apache Cassandra(R) extension for Quarkus
Apache License 2.0
39 stars 28 forks source link

Testing of Quarkus Applications with Cassandra #142

Closed hellf-ms closed 3 years ago

hellf-ms commented 3 years ago

I have the problem, always when starting a test and the database is not connected, my test won't run, cause of the app starts to try to connect and runs in a timeout. So the tests will never be executed.

Do you have a good strategy for testing cassandra applications or better datastax enterprise, cause I also user graph? Is there a testcontainer image for that or maybe other better way?

┆Issue is synchronized with this Jira Task by Unito

adutra commented 3 years ago

Hi, there is a Cassandra module for TestContainers: https://www.testcontainers.org/modules/databases/cassandra/

It also works with DSE, you only need to create the module with a DSE Docker image.

DataStax maintains several Docker images that you can use:

You can also have a look at this: https://docs.datastax.com/en/docker/doc/docker/dockerQuickStart.html

If you need to integrate TestContainers in a Quarkus test, have a look at our CassandraTestResource.

As for the timeouts in your tests, if you have an example I could take a look.

adutra commented 3 years ago

Closing this for now, feel free to re-open if you need further assistance. Thanks!