fix: quality, correctness and maintenance improvements#92
Open
scolladon wants to merge 26 commits into
Open
Conversation
…rationExceptionBuilder
This reverts commit d18715049b6dbb8be4476cf3af988f011071db24.
The class was never thrown by the library and existed only as a deprecated stub. Removes the class and all references in docs.
…havior assertion - Guard getType() and TypeMatchable.matches() against null typeName to prevent NPE after the null guard added to getTypeName() - Update test assertion to check for 'SpyBehavior' matching the actual error message thrown by BehaviorManagement.configure()
- Move 'Test' (general) assertion after 'Test Times' x3 (times) for arg 10, since once/times behaviors are always consumed before the general fallback - Fix behave assertions to use arg -1 (matching the setup) instead of arg 10, and reduce from 5 to 4 calls (1 thenBehaveOnce + 3 thenBehave(times))
npm: - @commitlint/cli: 19.5.0 → 20.5.0 - @commitlint/config-conventional: 19.5.0 → 20.5.0 - @prettier/plugin-xml: 3.4.1 → 3.4.2 - husky: 9.1.6 → 9.1.7 - lint-staged: 15.2.10 → 16.4.0 - prettier: 3.3.3 → 3.8.1 - prettier-plugin-apex: 2.1.5 → 2.2.6 - wireit: 0.14.9 → 0.14.12 GitHub Actions: - actions/checkout: v4 → v6 - actions/setup-node: v4 → v6 - amannn/action-semantic-pull-request: v5 → v6
Fields are only accessed within the outer Expect class which has access to private inner class members in Apex, making public unnecessary.
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.
Description
A collection of fixes, refactors, and maintenance improvements accumulated in the tech backlog:
Fixes
BehaviorManagement.configureagainst nullSpyBehaviorand negativetimesgetTypeName()against null and propagate null handling togetType()andTypeMatchable.matches()Boolean(capital) consistently onmatches()in Argument matchersMock.stubto private set to prevent external mutationbehavesandbehavesOncedocumentationRefactors
dispatchBehavior()fromMethodSpy.call()for clarityOncesubclasses with label constructor parameterdescribeConfigurations()to fix Feature Envy inConfigurationExceptionBuilderErrorMessageRowfield visibility inExpectArgument.ConfigurationExceptiondead codeTests
@IsTestannotation toMethodSpyTestareListsEqual returnsFalse -> returnsTrueMockTestexception assertionFunctionalTestDocs
DESIGN.mddocumenting library architecture and key decisionsJSONMatchableChore
isConfigured()to avoid scanning all behaviorsMotivation and Context
These changes address accumulated technical debt and correctness issues found during code review and from a community-reported documentation bug (wrong assertion order in the parameterized configuration README example).
How Has This Been Tested?
All 138 Apex tests pass (100% pass rate) against a scratch org.
closes #88