The test header correctly shows the Named.of("display", payload) display name, but the parameter table shows the raw payload.
Root cause
Two different sources; only one sees Named:
- Header (correct): uses
ExtensionContext.displayName, which JUnit pre-formats via Named.getName() (KensaExtension.kt → JsonTransforms.kt:73).
- Parameter table (wrong): built from
invocationContext.arguments, which JUnit has already unwrapped to payloads at the resolver boundary (ResolverFacade.getConsumedPayload). Kensa indexes positionally in ParameterElementDescriptor.resolveValue (ElementDescriptor.kt:66) → NamedValue(name, rawPayload) → JsonTransforms.kt:64.
No code references org.junit.jupiter.params.provider.Named anywhere. The Named wrapper is gone before Kensa captures.
Feasibility
No public JUnit hook exposes the Named wrapper at capture time. EvaluatedArgumentSet retains it (getConsumedNames()) but is package-private and never stored; the public ParameterInfo accessor yields payloads only.
- Option A (recommended, medium): parse per-parameter names out of
context.displayName (the {argumentsWithNames} formatter already renders getConsumedNames()[i]), correlate positionally with captured payloads, substitute the Named name. No reflection, no user test changes. Fragile only for custom @ParameterizedTest(name=...) patterns → fall back to payload toString().
- Option B (rejected, hard): reflect into JUnit-internal
EvaluatedArgumentSet — brittle across releases (5.14/6.0 differ). Not worth the maintenance cost.
Scope
frameworks/junit/junit5 (and junit6). Affects the parameter table only; header is unaffected.
The test header correctly shows the
Named.of("display", payload)display name, but the parameter table shows the raw payload.Root cause
Two different sources; only one sees
Named:ExtensionContext.displayName, which JUnit pre-formats viaNamed.getName()(KensaExtension.kt→JsonTransforms.kt:73).invocationContext.arguments, which JUnit has already unwrapped to payloads at the resolver boundary (ResolverFacade.getConsumedPayload). Kensa indexes positionally inParameterElementDescriptor.resolveValue(ElementDescriptor.kt:66) →NamedValue(name, rawPayload)→JsonTransforms.kt:64.No code references
org.junit.jupiter.params.provider.Namedanywhere. TheNamedwrapper is gone before Kensa captures.Feasibility
No public JUnit hook exposes the
Namedwrapper at capture time.EvaluatedArgumentSetretains it (getConsumedNames()) but is package-private and never stored; the publicParameterInfoaccessor yields payloads only.context.displayName(the{argumentsWithNames}formatter already rendersgetConsumedNames()[i]), correlate positionally with captured payloads, substitute theNamedname. No reflection, no user test changes. Fragile only for custom@ParameterizedTest(name=...)patterns → fall back to payloadtoString().EvaluatedArgumentSet— brittle across releases (5.14/6.0 differ). Not worth the maintenance cost.Scope
frameworks/junit/junit5(and junit6). Affects the parameter table only; header is unaffected.