Hooks
Hooks let you customize behavior around engine and factory lifecycle events.
Factory creation hooks:
WithBeforeEngineCreateWithAfterEngineCreate
Engine execution hooks:
WithBeforeEngineRunWithAfterEngineRun
Engine seeding hooks:
WithBeforeEngineSeed
Engine teardown hooks:
WithBeforeEngineTeardownWithAfterEngineTeardown
Factory close hooks:
WithBeforeFactoryCloseWithAfterFactoryClose
before*hooks run in registration order.after*hooks run in reverse registration order.- Hook errors are joined and returned.
| |
A real use case from examples is closing testcontainers resources with WithAfterFactoryClose.