XWIKI-8931 and XWIKI-8933: Use Mockito for tests