Introduction
BRUT 5.1.0 introduces annotation-based testing for brXM delivery tier with 66-74% less boilerplate
than legacy abstract classes. Write tests with simple annotations and let BRUT handle the infrastructure.
Quick Example
@BrxmJaxrsTest(resources = {HelloResource.class})
class MyApiTest {
@Test
void testEndpoint(DynamicJaxrsTest brxm) {
brxm.request()
.get("/site/api/hello/world")
.assertBody("Hello, World!");
}
}
That's it! No abstract classes, no 30+ lines of configuration, no lifecycle management.
Key Features
- Zero-Config Auto-Detection - Bean packages discovered from project structure
- JUnit 5 Parameter Injection - Test harness injected via
@Test method parameters
- Fluent Request API - Chainable request building with typed responses
- ConfigService Integration - Production-parity testing with one-liner setup
- Three Test Types - Components, JAX-RS APIs, and Page Model
Module Overview
| Module |
Purpose |
Use For |
| brut-common |
In-memory JCR repository, YAML import, JUnit 5 extensions |
Shared infrastructure |
| brut-components |
HST Component testing with @BrxmComponentTest |
Component Tests |
| brut-resources |
JAX-RS and Page Model testing |
JAX-RS / Page Model |