-
Notifications
You must be signed in to change notification settings - Fork 47
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
UtBot mocks interface even when Do not mock
is selected
#1560
Comments
@CaelmBleidd Do you think some simple fix is possible here? Or the fix would definitely require significant amount of instigation/work? Regarding expected result: in case we have to mock in this situation then we need to add dependency to avoid red code. |
No, I believe, it requires either a little work or no work at all. We have a similar mechanism for so-called Probably, it'd be enough to just add in the @EgorkaKulikov please, take a look at it. Am I right that it is enough to solve the problem? |
Description
UtBot tries to mock parameter which type is interface without existing implementations. As
Do not mock
selected no Mockito dependencies are added and so generated code cannot be executed.To Reproduce
Steps to reproduce the behavior:
Do not mock
optionExpected behavior
Generated tests have no mocks and can be executed. Or no tests are generated.
Actual behavior
Generated tests shown below. It contains references to Mockito
when
andactual
, but because there is no Mockito dependency in the project, such tests cannot be executed.Visual proofs (screenshots, logs, images)

Environment
IDEA 2022.2.3
UTBot 2022.12.637 from unit-test-bot/rc16122022 branch
Additional context
That seems quite old bug, as it's reproducible in 2022.10.580 version of UTBot too.
The text was updated successfully, but these errors were encountered: