Package com.aim2be.platform.test
Annotation Interface AutoConfigureOutbox
@Documented
@Inherited
@Retention(RUNTIME)
@Target(TYPE)
@Import(OutboxTestAutoConfiguration.class)
@PropertyMapping("im2be.outbox.test")
public @interface AutoConfigureOutbox
Test annotation that activates an in-memory outbox +
TestOutboxRecordCaptor
for the duration of the test class (per OQ-6 ยง1.5 in
.planning/26-stage-b-outbox-parity.md).
Usage in downstream services:
@SpringBootTest
@AutoConfigureOutbox
class CalendarEventEmissionTest {
@Autowired
TestOutboxRecordCaptor captor;
@Test
void emits_calendar_event_to_outbox() {
service.createEvent(...);
captor.assertEmittedExactly(1, OutboxRecord.Status.PENDING);
}
}
Maps to im2be.outbox.test.captor-enabled=true which the
OutboxTestAutoConfiguration class consumes.
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionbooleanIftrue(default), theTestOutboxRecordCaptorbean is exposed for assertions.
-
Element Details
-
captorEnabled
boolean captorEnabledIftrue(default), theTestOutboxRecordCaptorbean is exposed for assertions. Set tofalseto activate the in-memory outbox without binding the captor (useful in tests that only need the autoconfig to NOT fail context refresh).- Returns:
- whether to expose the captor bean
- Default:
- true
-