Module agentforge4j.testkit
Package com.agentforge4j.testkit.capture
Class CapturingWorkflowEventLog
java.lang.Object
com.agentforge4j.testkit.capture.CapturingWorkflowEventLog
- All Implemented Interfaces:
WorkflowEventLog
A
WorkflowEventLog decorator that records every appended event in order while delegating
to a backing log. All runtime events flow through WorkflowEventLog.append, so this
captures the full ordered event stream for assertions.
The backing log is appended to first; the event is recorded only once that delegate
call returns normally. A delegate that rejects an event therefore leaves it out of
capturedEvents(), so the capture reflects only events the backing log actually accepted
and never reports an event the runtime failed to persist.
-
Constructor Summary
ConstructorsConstructorDescriptionCapturingWorkflowEventLog(WorkflowEventLog delegate) Decorates the given backing log. -
Method Summary
Modifier and TypeMethodDescriptionvoidappend(WorkflowEvent event) Persistseventfor later retrieval withWorkflowEventLog.getEvents(String).Returns every event appended through this decorator, across all runs, in append order.Returns events forrunIdin a stable, typically chronological order defined by the implementation.
-
Constructor Details
-
CapturingWorkflowEventLog
Decorates the given backing log.- Parameters:
delegate- the backing event log; must not benull
-
-
Method Details
-
append
Description copied from interface:WorkflowEventLogPersistseventfor later retrieval withWorkflowEventLog.getEvents(String).- Specified by:
appendin interfaceWorkflowEventLog- Parameters:
event- non-null event to store
-
getEvents
Description copied from interface:WorkflowEventLogReturns events forrunIdin a stable, typically chronological order defined by the implementation.- Specified by:
getEventsin interfaceWorkflowEventLog- Parameters:
runId- run to query
-
capturedEvents
Returns every event appended through this decorator, across all runs, in append order.- Returns:
- an immutable snapshot of the captured events
-