diff --git a/src/main/java/org/jboss/arquillian/testcontainers/TestContainersObserver.java b/src/main/java/org/jboss/arquillian/testcontainers/TestContainersObserver.java index dcc2517..4bf992a 100644 --- a/src/main/java/org/jboss/arquillian/testcontainers/TestContainersObserver.java +++ b/src/main/java/org/jboss/arquillian/testcontainers/TestContainersObserver.java @@ -42,7 +42,15 @@ public void createContainer(@Observes(precedence = 500) BeforeClass beforeClass) final DockerRequired dockerRequired = javaClass.getAnnotation(DockerRequired.class); if (dockerRequired != null) { if (!isDockerAvailable()) { - throw createException(dockerRequired.value()); + var throwable = dockerRequired.value(); + final var overrideClass = System.getProperty("org.arquillian.testcontainers.docker.required.exception"); + if (overrideClass != null && !overrideClass.isBlank()) { + Class override = Class.forName(overrideClass); + if (override.isAssignableFrom(Throwable.class)) { + throwable = (Class) override; + } + } + throw createException(throwable); } } final TestcontainerRegistry instances = new TestcontainerRegistry();