OK, but I'll probably not write these tests for 3 reasons.
1. As you say, mocking XWiki is a mess and you never know what to mock
2. It tooks me more time to write these tests and understand what is mocking and how JMock works and how to manage my problems that to actually write the patch
3. In my opinion, unit tests should be written by another developer (at least, that's what I learned for best practices)