There are times when a test should be skipped if Docker is not available, while at other times the test should fail. For example, one might want the containerized test to run on Mac or Linux, but not on Windows. This behavior should be easily configured. For example, in the WildFly codebase (from which these annotations were taken), a system property is examined to determine whether to skip or fail. This project needs this sort of flexibility.
For example
if (!isDockerAvailable()) {
if ("true".equals(System.getProperty("arquillian.testcontainers.require.docker"))) {
throw new RuntimeException("Docker is required but it is not available or is not properly configured");
} else {
throw createException(dockerRequired.value());
}
}
Another option might be to have a system property like org.arquillian.testcontainers.required.exception=java.lang.AssertionError and allow the type to be overridden.
There are times when a test should be skipped if Docker is not available, while at other times the test should fail. For example, one might want the containerized test to run on Mac or Linux, but not on Windows. This behavior should be easily configured. For example, in the WildFly codebase (from which these annotations were taken), a system property is examined to determine whether to skip or fail. This project needs this sort of flexibility.
For example