Introduction
BRUT provides annotation-based testing for brXM delivery-tier components. Annotate a test class and BRUT handles the infrastructure — repository bootstrap, HST container, and request pipelines.
Quick Example
@BrxmJaxrsTest(resources = {HelloResource.class})
class MyApiTest {
@Test
void testEndpoint(DynamicJaxrsTest brxm) {
brxm.request()
.get("/site/api/hello/world")
.assertBody("Hello, World!");
}
}
No abstract classes, no lifecycle management, no boilerplate configuration.
Key Features
- Bean packages auto-detected from project structure; override with
beanPackages when needed
- Test harness injected via
@Test method parameters or field injection
- Fluent request builder: chainable setup with typed response deserialization
- Load real HCM modules into the test repository with
loadProjectContent = true
- 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 |