Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes 3231: Add a lightweight extension quicker but with more limited… #3232

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

topizio
Copy link

@topizio topizio commented Jan 10, 2024

This implementation is meant to be a replacement for tests where automatic mock injections aren't needed but test speed is the priority. This, without allowing mocks to be over-mocked.

You can see hereby the speed on a given test, from:
image

to:
image

The test is defined as:

ExtendWith(MockitoLightweightExtension.class)
class CapabilityFeatureVerifierTest {

	private final FeatureToggleService featureToggleService = mock(FeatureToggleService.class);

	private final CapabilityFeatureVerifier capabilityFeatureVerifier = new CapabilityFeatureVerifier(
			featureToggleService);
}

Over-mocking is still detected over mock fields and regular mocks:

image

Thanks in advance for your time!

Checklist

  • Read the contributing guide
  • PR should be motivated, i.e. what does it fix, why, and if relevant how
  • If possible / relevant include an example in the description, that could help all readers
    including project members to get a better picture of the change
  • Avoid other runtime dependencies
  • Meaningful commit history ; intention is important please rebase your commit history so that each
    commit is meaningful and help the people that will explore a change in 2 years
  • The pull request follows coding style
  • Mention Fixes #<issue number> in the description if relevant
  • At least one commit should mention Fixes #<issue number> if relevant

@topizio
Copy link
Author

topizio commented Jan 29, 2024

Hi @TimvdLippe , I kindly would like to know if this PR and its related issue are enough or if by any chance I'm still missing something in order to have this PR to be processed. Many thanks in advance for your time! :-)

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.

None yet

1 participant