
JUnit EnabledIf DisabledIf Conditional Test Execution Guide
Run JUnit tests only when a condition holds: EnabledOnOs, EnabledForJreRange, EnabledIfEnvironmentVariable, EnabledIf and custom ExecutionCondition.
Tag
223 posts

Run JUnit tests only when a condition holds: EnabledOnOs, EnabledForJreRange, EnabledIfEnvironmentVariable, EnabledIf and custom ExecutionCondition.

Use jcmd, jstack and jmap on a live Java process without causing an outage: which commands pause the JVM, how to attach in containers and what to capture.

Configure packages, namespaces, actions, results and interceptor stacks in struts.xml, and use wildcards without opening dangerous method calls.

Add a database to a Play application with the Ebean plugin or with JPA and Hibernate, configure the connection and pick the one that fits your team.

Test a Micronaut application with MicronautTest, an injected HTTP client, mock beans and Test Resources that start real containers for databases.

Build charts and a dashboard in Vaadin Flow with the Chart component and Configuration API, update data from the server, and plan for the commercial licence.

Use Hibernate batch fetch size to turn N plus 1 queries into a few IN queries: global setting, per association annotation, trade-offs and how to verify.

Write the OpenAPI document first, then generate Java interfaces and models from it, implement them, and fail the build when code and contract drift apart.

Use Spring Boot Docker Compose support to start compose.yaml services automatically in development, wire connections and control lifecycle.

Prevent XML external entity attacks in Java: disable DOCTYPE and external entities on DocumentBuilder, SAX, StAX, TransformerFactory and XMLReader.

Size a Java thread pool with the cores times wait over compute formula, split CPU and IO pools, measure, and consider virtual threads.

Do contract testing with Pact in Java: consumer tests that generate a contract, provider verification, the Pact Broker, can-i-deploy and CI workflow.