I need to switch off the Cassandra database connectivity/health test at startup of the Quarkus application. The application starts successfully, only if it can reach the database. I need to switch it off only for tests, e.g. when I run tests with maven (mvn clean install). Is there a way to configure it in the application.properties or somewhere else?
Thanks in advance! :-)
You can use Quarkus profiles to change which Cassandra database your tests connect to. For example,
%prod.quarkus.cassandra.contact-points=my-cassandra:9042
%dev.quarkus.cassandra.contact-points=127.0.0.1:9042
That might get you part of the way. As Erick Ramirez says, completely disabling the Cassandra parts of the application will have some downsides in terms of test coverage (and test realism). For many Quarkus extensions, there are dev services which will automatically stand up an instance of the dependency when tests are run, and in dev mode. It doesn't look like that's been implemented for the Cassandra extension yet. As an alternative, you might be able to use the testcontainers Cassandra support. It's more work than having Quarkus dev services do it 'for free', but not impossible.