feat(g15a): Faker / random templating helper, structurally validated#54
Merged
Conversation
Add {{random 'Class.method'}} — fake data from a Datafaker-style expression,
mirroring WireMock's faker extension (the random helper, backed by
Datafaker). Mockifyr uses Bogus, Datafaker's .NET counterpart, over a
curated provider subset (Name/Internet/Address/Number/Company/Lorem/
PhoneNumber). An unknown expression yields WireMock's own error string
([ERROR: Unable to evaluate the expression <expr>]).
Faker output is non-deterministic, so it can't be byte-diffed against the
oracle. Validated structurally instead (the racy-feature method used by the
random helpers and now): the same stub is served by the oracle (WireMock +
the faker extension) and Mockifyr, and over 15 iterations each generated
field must satisfy a format contract on both sides. The oracle satisfying
the contract proves it is real WireMock/Datafaker behavior; Mockifyr (Bogus)
satisfying the same contract is the parity claim.
Suite green (105 differential, 9 application).
Deferred (tracked): the long tail of Datafaker providers beyond the curated
subset (added on demand); locale selection.
Refs: G15a
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
G15a — Faker /
randomtemplating helperOpens the G15 group.
{{random 'Class.method'}}renders fake data from a Datafaker-style expression, mirroring WireMock's faker extension (therandomhelper, backed by Datafaker). Mockifyr uses Bogus — Datafaker's .NET counterpart.What's supported
A curated subset of the most common providers:
Name.firstName/lastName/fullName,Internet.emailAddress/url/uuid,Address.city/country/zipCode,Number.digit,Company.name,Lorem.word,PhoneNumber.phoneNumber. An unknown expression yields WireMock's own error string:[ERROR: Unable to evaluate the expression <expr>].How it's validated (the racy-feature method)
Faker output is non-deterministic, so it can't be byte-diffed. Validated structurally instead — the same method the
randomValuehelpers (G2e) andnowuse:G15aFakerTests.FakerHelper_StructurallyMatchesTheOracle, 9 fields.Full suite: 105 differential, 9 application, 0 warnings.
Explicitly deferred (tracked)
The long tail of Datafaker providers beyond the curated subset (added on demand); locale selection.
New dep:
Bogus 35.6.5(MIT), used only insideMockifyr.Templating. The faker extension jar is fetched from Maven Central at test time (cached), not committed.Docs:
docs/parity/g15-extras.md(new),docs/roadmap.md(G15a ticked).🤖 Generated with Claude Code