Very simple test case (no other code) :
@QuarkusTest
class EndpointTest {
@Test
void testPostMV() {
fail("Not yet implemented"); // TODO
}
}
POM.xml :
...
<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-reactive-messaging-rabbitmq</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-openapi</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-reactive</artifactId>
</dependency>
<!-- TESTS -->
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
...
When mvn -Dtest=org.avm.rest.EndpointTest test
I see in logs :
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running org.avm.rest.EndpointTest
2023-04-12 13:23:54,426 WARN [io.qua.arc.dep.SplitPackageProcessor] (build-26) Detected a split package usage which is considered a bad practice and should be avoided. Following packages were detected in multiple archives:
- "io.smallrye.reactive.messaging.providers.connectors" found in [io.smallrye.reactive:smallrye-reactive-messaging-in-memory::jar, io.smallrye.reactive:smallrye-reactive-messaging-provider::jar]
2023-04-12 13:23:54,541 INFO [org.tes.doc.DockerClientProviderStrategy] (build-26) Loaded org.testcontainers.dockerclient.UnixSocketClientProviderStrategy from ~/.testcontainers.properties, will try it first
2023-04-12 13:23:55,083 INFO [org.tes.doc.DockerClientProviderStrategy] (build-26) Found Docker environment with local Unix socket (unix:///var/run/docker.sock)
2023-04-12 13:23:55,085 INFO [org.tes.DockerClientFactory] (build-26) Docker host IP address is localhost
2023-04-12 13:23:55,102 INFO [org.tes.DockerClientFactory] (build-26) Connected to docker:
Server Version: 23.0.3
API Version: 1.42
Operating System: Debian GNU/Linux 10 (buster)
Total Memory: 31757 MB
2023-04-12 13:23:55,115 INFO [org.tes.uti.ImageNameSubstitutor] (build-26) Image name substitution will be performed by: DefaultImageNameSubstitutor (composite of 'ConfigurationFileImageNameSubstitutor' and 'PrefixingImageNameSubstitutor')
2023-04-12 13:23:55,119 INFO [org.tes.DockerClientFactory] (build-26) Checking the system...
2023-04-12 13:23:55,120 INFO [org.tes.DockerClientFactory] (build-26) ✔︎ Docker server version should be at least 1.6.0
2023-04-12 13:23:55,188 INFO [ .9-management]] (build-26) Creating container for image: rabbitmq:3.9-management
2023-04-12 13:23:55,211 INFO [ .3.4]] (build-26) Creating container for image: testcontainers/ryuk:0.3.4
2023-04-12 13:23:55,346 INFO [ .3.4]] (build-26) Container testcontainers/ryuk:0.3.4 is starting: ec8edc09f60e0179e1c6a9269e542a52f53de468fec15c1042ea7dde29aac2be
2023-04-12 13:23:55,859 INFO [ .3.4]] (build-26) Container testcontainers/ryuk:0.3.4 started in PT0.648579S
2023-04-12 13:23:56,109 INFO [ .9-management]] (build-26) Container rabbitmq:3.9-management is starting: a29cd698eed414e0ffa0ee2225d230504e6a332a022aec31f545104aa5f6ec85
2023-04-12 13:24:01,766 INFO [ .9-management]] (build-26) Container rabbitmq:3.9-management started in PT6.63349S
If I suppress quarkus-smallrye-reactive-messaging-rabbitmq
from the POM file, then the simple test runs normally :
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running org.avm.rest.EndpointTest
2023-04-12 13:34:28,106 INFO [io.quarkus] (main) realtime_proxy_mt 2.16 on JVM (powered by Quarkus 2.16.1.Final) started in 1.880s. Listening on: http://localhost:8081
2023-04-12 13:34:28,111 INFO [io.quarkus] (main) Profile test activated.
2023-04-12 13:34:28,111 INFO [io.quarkus] (main) Installed features: [cdi, rabbitmq-extension, resteasy-reactive, smallrye-context-propagation, smallrye-openapi, swagger-ui, vertx]
[ERROR] Tests run: 3, Failures: 3, Errors: 0, Skipped: 0, Time elapsed: 4.319 s <<< FAILURE! - in org.avm.rest.EndpointTest
Nowhere I set testContainer ; I don'tunderstand Why it is launched... I have another project with the same dependencies which doesn't launch testcontainers for tests ; I don't see any difference ... I am stuck. Is there someone else in the same situation ? Some hints, maybe ?