docs(examples): Act 3 (introspection) for the MapStruct head-to-head + narrated test logging#218
Merged
Merged
Conversation
…+ 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 Report✅ All modified and coverable lines are covered by tests. 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. |
There was a problem hiding this comment.
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_MAPPERso 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.
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.
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.)
- 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds Act 3 — introspection to the canonical
telescopevs 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
CUSTOMER_MAPPER(Customer → CustomerDto) soexplain()renders the Act 1 rename as first-class data:✓ email → contactEmail. The test asserts on it viaexplain().mapped()— a completeness check MapStruct has no surface for.ORDER_MAPPER.trace(order)— the same rows with real values, whole nested graph.java.lang.System.Logger.Narrated test logging
java.lang.System.Logger(the same zero-dependency facade telescope uses for its own auto-logging) — noSystem.out.testtask is wired withshowStandardStreams+events(passed/failed/skipped)and a message-only JUL format, so./gradlew :examples:mapstruct-vs-telescope:testreads 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.