tests: one behavioral IT per feature for amend, cascade, numbering and the check gate (#7162) - #7244
Merged
Merged
Conversation
…d the check gate (#7162) Four recent features were pinned only by assertions over emitted source, which compiles the generated code and exercises none of it. Each gets one IT that generates the model, publishes the application and drives the claim over REST. - IntentPostingAmendIT (#7071): issue, reject, edit, issue again - the post is rewritten in place, a redelivery is a no-op, and the rewrite stops once the created entry has left the status it was posted in. - IntentCompositionCascadeIT (#7100): a deleted master's children are gone, the roll-up over them relinquished (so they left through their own repositories), a `whenMasterDeleted: refuse` sibling stops the delete, and a refusal one level down rolls the whole cascade back. - IntentNumberingPartitionIT (#7101): two companies allocate from one `per: Company` series and both start at 1; the control series without `init:` reproduces the base-row fork the fix exists to prevent. - IntentCheckGateRefusalIT (#7063): a check-gated approval is refused as the 400 the task completion returns, on both routes that converge on the gate, with the document untouched and the task still the approver's. Each was verified against a mutated build: reverting the fix under test turns the corresponding IT red at the assertion that names the defect. Fixes #7162 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
||
| /** The sequence half of an allocated number - the three-letter prefix, then the padded counter. */ | ||
| private static int sequenceOf(String number) { | ||
| return Integer.parseInt(number.substring(3)); |
This was referenced Sep 10, 2026
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.
The gap
Four recent features were pinned only by assertions over EMITTED SOURCE -
contains("UnitOfWork.run("),contains("itemsRepository.delete(stale)"),flowable:asyncattributes, descriptor keys. That compiles the generated code and exercises none of it, which is why several defects filed alongside #7162 were invisible to CI.Each feature now has one IT on the
IntentGeneratesItemsITmodel - write the intent, call the Generate endpoint the IDE calls, publish, and drive the claim over REST through the published application.What each one asserts
IntentPostingAmendIT(#7071) - the documented amend loop, walked as a user walks it: issue a document, reject it, edit the amount, issue again. The post is rewritten in place with the new amounts (same entry, never a second one); a redelivery with nothing edited changes nothing, so the loop is not "rewrite on every event"; and once the created entry has left the status the posting created it in, the divergence is reported and the entry left alone for a correcting entry. Before the fix the handler answered the second issue with its idempotency test and left a DRAFT entry 60.00 short of the document it referenced - with nothing anywhere saying so.IntentCompositionCascadeIT(#7100) - three runtime claims, one fixture. A deleted master's children are gone; the roll-up over them relinquished what it counted, which is what proves they left through their own repositories rather than one SQL statement (the same defect with the rows hidden); a sibling declaringwhenMasterDeleted: refusestops the delete and the trip keeps its legs; and a refusal one level down - a leg carrying a note - rolls the whole cascade back, including the sibling leg the cascade had already deleted.IntentNumberingPartitionIT(#7101) - two companies allocate from oneper: Companyseries and both start at 1, interleaved so the counters are shown to run independently. The second series is the control and reproduces the mechanism: with noinit:on the partition relation its documents run the tenant-wide base row up, and the partition materialized for the second company afterwards forks from that counter (#6517) - exactly what theinit:series did before the fix. It also keeps the four assertions above from passing on a build that had simply stopped partitioning.IntentCheckGateRefusalIT(#7063) - a check-gated approval is refused as the 400 the task completion returns, carrying the authored message; the document stays DRAFT and the task is still the approver's to retry, not a dead-letter incident only an administrator can find. The gate is reached by two routes - one hop on the approve arm, two on the arm behind the rating resolver (the node the shared visited set of #7139 left asynchronous) - and route 1's customer is deliberately unrated, so that route is the only way to the gate and cannot be silently taken by the other. The ungated reject branch of the same decision is the control.Verification
All four run green together (
-Dit.test="IntentCompositionCascadeIT,IntentNumberingPartitionIT,IntentPostingAmendIT,IntentCheckGateRefusalIT"), and each was run against a mutated build so it is not a test that cannot fail:IntentCheckGateRefusalITcompletingTransactionNodesbypassed (pre-#7065)IntentNumberingPartitionITapplyDefaultsneutered (the #7147 regression the issue names)IntentCompositionCascadeITdeleteOwnedChildrenneutered (pre-#7100)IntentPostingAmendITwas not mutation-tested; its three outcomes are distinguished by the assertions themselves (one entry, unchanged amounts, the reported divergence read off the handler's log).mvn formatter:validateclean on the touched module.Fixes #7162
🤖 Generated with Claude Code