### Question:
WikiUserFromXEMMigration extends AbstractHibernateDataMigration { private void upgradeRegularSubwiki(String wikiId) throws DataMigrationException, XWikiException { WikiUserConfiguration configuration = new WikiUserConfiguration(); configuration.setUserScope(UserScope.LOCAL_AND_GLOBAL); configuration.setMembershipType(MembershipType.INVITE); saveConfiguration(configuration, wikiId); }  @Override String getDescription(); @Override XWikiDBVersion getVersion(); @Override boolean shouldExecute(XWikiDBVersion startupVersion);  }### Answer:
@Test public void upgradeRegularSubWiki() throws Exception { when(wikiDescriptorManager.getCurrentWikiId()).thenReturn("subwiki"); XWikiDocument oldDescriptorDocument = mock(XWikiDocument.class); when(xwiki.getDocument(eq(new DocumentReference("mainWiki", XWiki.SYSTEM_SPACE, "XWikiServerSubwiki")), any(XWikiContext.class))).thenReturn(oldDescriptorDocument); when(oldDescriptorDocument.getXObject(eq(new DocumentReference("mainWiki", "WorkspaceManager", "WorkspaceClass") ))).thenReturn(null); mocker.getComponentUnderTest().hibernateMigrate(); WikiUserConfiguration expectedConfiguration = new WikiUserConfiguration(); expectedConfiguration.setUserScope(UserScope.LOCAL_AND_GLOBAL); expectedConfiguration.setMembershipType(MembershipType.INVITE); verify(wikiUserConfigurationHelper).saveConfiguration(eq(expectedConfiguration), eq("subwiki")); }