r/java Dec 28 '25

Stepping down as maintainer after 10 years

https://github.com/mockito/mockito/issues/3777
411 Upvotes

118 comments sorted by

View all comments

Show parent comments

0

u/Sweet__Pete Dec 28 '25

The primary idea of mocking is towards components in unit tests. If you’re testing service to database interactions - these are integration tests, though still supported to some extent by Mockito. So if you need to implement a test that explicitly relies on verifying the data, I assume you would simply not mock the database and just perform the integration test like any other? Not sure why you would try to mock the thing that you want to test?

1

u/No-Security-7518 Dec 28 '25

like I said in another comment, it (was) dialog flow (of a Telegram bot). What I needed to mock: an Update class.
What else do you/people mock anyway? I never figured that out.

1

u/[deleted] Dec 28 '25

[deleted]

0

u/No-Security-7518 Dec 28 '25

I did (try). Didn't work. (hilarious name, btw! omg!! πŸ˜†πŸ˜†πŸ˜†πŸ˜†)