Package io.karatelabs.core
Record Class ScenarioRunEvent
java.lang.Object
java.lang.Record
io.karatelabs.core.ScenarioRunEvent
- All Implemented Interfaces:
RunEvent
public record ScenarioRunEvent(RunEventType type, ScenarioRuntime source, ScenarioResult result, long timeStamp)
extends Record
implements RunEvent
Scenario-level events (SCENARIO_ENTER, SCENARIO_EXIT).
-
Constructor Summary
ConstructorsConstructorDescriptionScenarioRunEvent(RunEventType type, ScenarioRuntime source, ScenarioResult result, long timeStamp) Creates an instance of aScenarioRunEventrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic ScenarioRunEvententer(ScenarioRuntime sr) final booleanIndicates whether some other object is "equal to" this one.static ScenarioRunEventexit(ScenarioRuntime sr, ScenarioResult result) longReturns the timestamp when this event occurred (epoch milliseconds).getType()Returns the event type.final inthashCode()Returns a hash code value for this object.result()Returns the value of theresultrecord component.source()Returns the value of thesourcerecord component.longReturns the value of thetimeStamprecord component.toJson()Serializes a thin per-scenario envelope: identity (feature path, slug, line, refId), name, description, tags, and (on EXIT) pass/fail + duration.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
ScenarioRunEvent
public ScenarioRunEvent(RunEventType type, ScenarioRuntime source, ScenarioResult result, long timeStamp) Creates an instance of aScenarioRunEventrecord class.- Parameters:
type- the value for thetyperecord componentsource- the value for thesourcerecord componentresult- the value for theresultrecord componenttimeStamp- the value for thetimeStamprecord component
-
-
Method Details
-
enter
-
exit
-
getType
Description copied from interface:RunEventReturns the event type. -
getTimeStamp
public long getTimeStamp()Description copied from interface:RunEventReturns the timestamp when this event occurred (epoch milliseconds).- Specified by:
getTimeStampin interfaceRunEvent
-
toJson
Serializes a thin per-scenario envelope: identity (feature path, slug, line, refId), name, description, tags, and (on EXIT) pass/fail + duration. For outline-examples,outlineSlug+exampleIndexlet receivers stitch back to the parent OUTLINE_ENTER event without denormalising outline metadata into every example.Step results — and any embeds attached to them by exts (e.g.
openapi-match,grpc-match) — are deliberately not emitted here. They reach receivers insideFEATURE_EXIT.data.scenarioResults[i].stepResults[j].embeds[]viaFeatureResult.toJson(), which already serializes the full scenario detail. Duplicating embeds ontoSCENARIO_EXITwould double the on-wire bytes for typical HTTP-heavy runs without giving consumers any new information — keep them at exactly one location on the wire. Seekarate/docs/DESIGN.md§JSONL stream for the cross-ext convention. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
source
Returns the value of thesourcerecord component.- Returns:
- the value of the
sourcerecord component
-
result
Returns the value of theresultrecord component.- Returns:
- the value of the
resultrecord component
-
timeStamp
public long timeStamp()Returns the value of thetimeStamprecord component.- Returns:
- the value of the
timeStamprecord component
-