Skip to content

fix: make fflib_MethodCountRecorder fields and methods non-static#166

Open
fransf-wtax wants to merge 1 commit into
apex-enterprise-patterns:masterfrom
wtaxco:WSS-167-Fix-MethodCountRecorder-static
Open

fix: make fflib_MethodCountRecorder fields and methods non-static#166
fransf-wtax wants to merge 1 commit into
apex-enterprise-patterns:masterfrom
wtaxco:WSS-167-Fix-MethodCountRecorder-static

Conversation

@fransf-wtax
Copy link
Copy Markdown

@fransf-wtax fransf-wtax commented Mar 18, 2026

This prevents loss of recorded invocations after an asynchronous flow runs as part of a unit test.

This ZIP file contains a small SFDX project that demonstrates the problem with the current ApexMocks code.
platform-event-mock-issue.zip

The proposed change would save the recorded method method invocations in a non-static variable, which Salesforce does preserve correctly when an asynchronous flow runs as part of a unit test.


This change is Reviewable

This prevents loss of recorded invocations after an asynchronous flow runs as part of a unit test.
@fransf-wtax
Copy link
Copy Markdown
Author

@ImJohnMDaniel Should I log an issue for this as well or is just the PR fine?

@ImJohnMDaniel
Copy link
Copy Markdown
Contributor

@ImJohnMDaniel Should I log an issue for this as well or is just the PR fine?

@fransf-wtax - yes, that would be helpful and would allow you to add more information related to the issue that you have seen.

@fransf-wtax
Copy link
Copy Markdown
Author

@ImJohnMDaniel #167

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.

2 participants