Skip to content

docs(examples): Act 3 (introspection) for the MapStruct head-to-head + narrated test logging#218

Merged
eschizoid merged 4 commits into
mainfrom
docs/mapstruct-slice-act3-introspection
Jul 5, 2026
Merged

docs(examples): Act 3 (introspection) for the MapStruct head-to-head + narrated test logging#218
eschizoid merged 4 commits into
mainfrom
docs/mapstruct-slice-act3-introspection

Conversation

@eschizoid

Copy link
Copy Markdown
Owner

What

Adds Act 3 — introspection to the canonical telescope vs MapStruct head-to-head, and makes the slice's tests narrate what they prove instead of just showing pass/fail.

Act 3 — telescope explains and traces itself; MapStruct is a black box

  • New CUSTOMER_MAPPER (Customer → CustomerDto) so explain() renders the Act 1 rename as first-class data: ✓ email → contactEmail. The test asserts on it via explain().mapped() — a completeness check MapStruct has no surface for.
  • Shows ORDER_MAPPER.trace(order) — the same rows with real values, whole nested graph.
  • Documents flip-a-level auto-logging through java.lang.System.Logger.
  • README gains the Act 3 section using the real captured output.

Narrated test logging

  • Every act now logs what it proves through java.lang.System.Logger (the same zero-dependency facade telescope uses for its own auto-logging) — no System.out.
  • The test task is wired with showStandardStreams + events(passed/failed/skipped) and a message-only JUL format, so ./gradlew :examples:mapstruct-vs-telescope:test reads as a head-to-head walkthrough, not a wall of green ticks.

Test

./gradlew :examples:mapstruct-vs-telescope:test — all acts green; the narration prints inline.

…+ narrated test logging

Capstones the slice with the differentiator MapStruct structurally lacks:

- Act 3: CUSTOMER_MAPPER.explain() renders the Act 1 rename as first-class data
  (✓ email → contactEmail), asserted via explain().mapped(); ORDER_MAPPER.trace()
  shows per-conversion values across the nested graph; flip-a-level auto-logging
  documented. README Act 3 uses the real captured output.
- Tests narrate each act through java.lang.System.Logger (no System.out), and the
  test task is wired with showStandardStreams + events + message-only JUL format
  so the run reads as a walkthrough rather than pass/fail ticks.
@codecov

codecov Bot commented Jul 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.59%. Comparing base (8ee96c2) to head (54dabe6).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #218   +/-   ##
=========================================
  Coverage     79.59%   79.59%           
  Complexity     1841     1841           
=========================================
  Files            80       80           
  Lines          5783     5783           
  Branches       1215     1215           
=========================================
  Hits           4603     4603           
  Misses          660      660           
  Partials        520      520           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Extends the examples/mapstruct-vs-telescope head-to-head to include an Act 3 focused on telescope introspection (explain() / trace(...)), and updates the slice to present test output as a narrated walkthrough via java.lang.System.Logger.

Changes:

  • Adds a dedicated CUSTOMER_MAPPER so the Act 1 rename is exposed as queryable introspection data (explain().mapped()), and adds an Act 3 test asserting on that structure and on traced values.
  • Updates the example README with an Act 3 section describing introspection and auto-logging.
  • Adjusts the example Gradle test task logging to surface narrated output and simplify JUL formatting.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
examples/mapstruct-vs-telescope/src/test/java/io/github/eschizoid/telescope/example/mapstruct/MapStructVsTelescopeTest.java Adds System.Logger narration, plus an Act 3 introspection test and a shared log(...) helper.
examples/mapstruct-vs-telescope/src/main/java/io/github/eschizoid/telescope/example/mapstruct/telescope/TelescopeMappings.java Introduces CUSTOMER_MAPPER to isolate and demonstrate Customer → CustomerDto introspection.
examples/mapstruct-vs-telescope/README.md Adds Act 3 documentation for explain() / trace(...) and auto-logging configuration guidance.
examples/mapstruct-vs-telescope/build.gradle.kts Configures Gradle test logging to show narrated output and apply message-only JUL formatting.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread examples/mapstruct-vs-telescope/README.md
Comment thread examples/mapstruct-vs-telescope/README.md
Adds `showStandardStreams` + per-test pass/fail/skip events + a message-only JUL
format to `tasks.withType<Test>` in the root `subprojects { }` block, so every
module's `./gradlew test` reads as a walkthrough (with any System.Logger
narration shown cleanly) instead of a silent wall of ticks. Drops the redundant
per-module block from the mapstruct-vs-telescope slice now that it is centralized.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

Comment thread examples/mapstruct-vs-telescope/build.gradle.kts Outdated
Adds junit.platform.output.capture.stdout/stderr to the root test config so each
test's direct stream output is filed under that test in the reports, alongside
Gradle's showStandardStreams live console streaming. (System.Logger narration,
routed through JUL's stream-caching ConsoleHandler, is still captured at suite
level by Gradle rather than per-test.)

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 5 changed files in this pull request and generated no new comments.

- Fix the generated-type reference: MapStruct's decision lives in
  OrderMapStructMapperImpl (there is no CustomerMapperImpl) — javadoc + test comment.
- Make 'every act narrates' true: add System.Logger narration to the footgun and
  Act 2 tests, so all five acts log what they prove.
- Correct the Act 3 auto-logging config example to the zero-dependency JUL default
  (logging.properties, TRACE -> FINER), noting the Logback/Spring Boot forms.
- Clarify the slice build comment: test-output plumbing is global (root subprojects),
  this slice adds narration on top.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 5 changed files in this pull request and generated no new comments.

@eschizoid eschizoid merged commit 0f7543b into main Jul 5, 2026
5 checks passed
@eschizoid eschizoid deleted the docs/mapstruct-slice-act3-introspection branch July 5, 2026 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants