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

Use single mock when backing bean is the same instance #15427

Merged
merged 1 commit into from
Mar 4, 2021

Conversation

geoand
Copy link
Contributor

@geoand geoand commented Mar 3, 2021

Fixes: #15411

@geoand
Copy link
Contributor Author

geoand commented Mar 3, 2021

Keeping in draft as master is broken for the moment. Once it is fixed, I'll move the PR out of draft

@geoand geoand marked this pull request as ready for review March 3, 2021 08:04
@geoand geoand requested a review from famod March 3, 2021 08:05
Copy link
Contributor

@mkouba mkouba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. But beware that there might be use cases where a shared mock does not help. For example, if both I2 and I3 extend some InterfaceX and a user would attempt to mock InterfaceX#foo() for each of the @InjectMock (it's a corner case but still ;-).

@geoand geoand force-pushed the #15411 branch 2 times, most recently from 7f5f38e to 4df5102 Compare March 3, 2021 12:04
@geoand
Copy link
Contributor Author

geoand commented Mar 3, 2021

Looks good. But beware that there might be use cases where a shared mock does not help. For example, if both I2 and I3 extend some InterfaceX and a user would attempt to mock InterfaceX#foo() for each of the @InjectMock (it's a corner case but still ;-).

Yeah true.

But at least this PR is better (or what both OP and @famod expected) than what we currently have :)

@geoand geoand added triage/waiting-for-ci Ready to merge when CI successfully finishes triage/backport? labels Mar 3, 2021
Copy link
Member

@famod famod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was only able to review this briefly but LGTM!

@geoand geoand merged commit d7a08cf into quarkusio:master Mar 4, 2021
@quarkus-bot quarkus-bot bot added this to the 1.13 - master milestone Mar 4, 2021
@geoand geoand deleted the #15411 branch March 4, 2021 10:23
@gsmet
Copy link
Member

gsmet commented Mar 8, 2021

Won't backport to 1.11 for now, we need some community baking for the PR.

This was referenced Mar 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/testing triage/waiting-for-ci Ready to merge when CI successfully finishes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@InjectMock replaces existing mocks
4 participants