
How to Write Custom Annotations as Meta Annotations in JUnit
Write composed annotations in JUnit 5 with meta annotations: combine tags, extensions and display names into reusable test annotations for cleaner test code.
Tag
223 posts

Write composed annotations in JUnit 5 with meta annotations: combine tags, extensions and display names into reusable test annotations for cleaner test code.

Accept file uploads in Struts 2 with size and type limits, safe file names and storage outside the web root, and know which settings and releases matter.

Write a custom Vaadin Flow component: compose existing components, or wrap a web component with Tag, JsModule, properties, events and server calls.

Shrink a Java Docker image in six steps: drop the JDK, build in a stage, layer the Spring Boot jar, choose the base, trim dependencies and run non-root.

Return RFC 9457 problem details from a Spring Boot API: ProblemDetail, ErrorResponse, a ControllerAdvice, extension members and enabling it globally.

Run real PostgreSQL or MySQL in Java tests with Testcontainers: dependencies, JUnit extension, JDBC URL, migrations, performance tips and Docker requirements.

Handle Kafka consumer rebalances and offset commits in Java: ConsumerRebalanceListener, manual commits, cooperative rebalancing and avoiding duplicates.

Learn how Quarkus ArC implements CDI: scopes, injection, producers, qualifiers, events and interceptors, and the build time rules that differ from full CDI.

Set timeouts with @Timeout and assertTimeout in JUnit 5, understand threading differences, and handle flaky tests without hiding real bugs through retries.

See what Hibernate really sends to the database: SQL logging with bind values, statistics, slow query logs, flush timing and detecting N plus 1 problems.

Build a Vaadin CRUD screen on Spring Data JPA: entity, repository, a lazy grid, a binder backed form and delete with confirmation, in one view.

Map your first JPA entity with Entity, Table, Id, GeneratedValue and Column, with the no argument constructor, equals and hashCode rules that Hibernate needs.