IMHO, the question of ownership is irrelevant.
The relevant question is the one of coupling, i.e. what does your test code specify. You certainly don't want test code which specifies details of the API of some library that you happen to use. This is what you get when you e.g. use Mockito to mock the library directly in your test class.
A widespread solution proposal for this problem is to create a wrapper around the library and then to mock the wrapper. But this has the following drawbacks:
- The code inside the wrapper is not tested.
- The wrapper may be an imperfect abstraction, so the API of the wrapper may need to be changed. If you mocked the wrapper in many tests, you have to adapt all these tests.
So instead, I would recommend to decouple tests from interfaces in productive code altogether. Don't put the mocks into the test code directly, but create a separate stub class which implements or mocks the productive interface. Then add a second interface to the stub which allows the tests to do the necessary setup or assertions. Then you only need to adapt one class in case the productive interface changes – and you could even afford to mock/stub the interface of a library that is complex or changes frequently.
Note: All this is assuming that it is in fact necessary to use a mock or stub. I didn't discuss this question here because it was not in scope of the OP's question. But really ask yourself if you have to use mocks/stubs at all. In my experience, they are overused...