Skip to content

feat(g15a): Faker / random templating helper, structurally validated#54

Merged
omercelikdev merged 1 commit into
mainfrom
feat/g15a-faker
Jul 5, 2026
Merged

feat(g15a): Faker / random templating helper, structurally validated#54
omercelikdev merged 1 commit into
mainfrom
feat/g15a-faker

Conversation

@omercelikdev

Copy link
Copy Markdown
Owner

G15a — Faker / random templating helper

Opens the G15 group. {{random 'Class.method'}} renders 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.

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 randomValue helpers (G2e) and now use:

The same stub is served by the oracle (WireMock + the official faker extension) and Mockifyr, and over 15 iterations each generated field must satisfy a format contract (email regex, a 5(-4)-digit zip, a single digit, a UUID, name/city letters…). The oracle satisfying the contract proves it is real WireMock/Datafaker behavior; Mockifyr (Bogus) satisfying the same contract is the parity claim.

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 inside Mockifyr.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

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>
@omercelikdev omercelikdev merged commit f4d2eed into main Jul 5, 2026
2 checks passed
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.

1 participant