@Test public void testImportUserWithoutWiki() throws FilterException, XWikiException, ParseException { UserInstanceOutputProperties outputProperties = new UserInstanceOutputProperties(); outputProperties.setVersionPreserved(true); outputProperties.setVerbose(false); importFromXML("userwithoutwiki", outputProperties); XWikiDocument userDocument = this.oldcore.getSpyXWiki() .getDocument(new DocumentReference("wiki", "XWiki", "user"), this.oldcore.getXWikiContext()); assertFalse(userDocument.isNew()); assertEquals(new DocumentReference("wiki", "XWiki", "user"), userDocument.getCreatorReference()); assertEquals(toDate("2000-01-10 00:00:00.0 UTC"), userDocument.getCreationDate()); assertEquals(new DocumentReference("wiki", "XWiki", "user"), userDocument.getAuthorReference()); assertEquals(toDate("2000-01-11 00:00:00.0 UTC"), userDocument.getDate()); assertEquals(toDate("2000-01-11 00:00:00.0 UTC"), userDocument.getContentUpdateDate()); assertEquals(new DocumentReference("wiki", "XWiki", "user"), userDocument.getContentAuthorReference()); assertEquals(false, userDocument.isMinorEdit()); assertEquals("Import", userDocument.getComment()); BaseObject userObject = userDocument.getXObject(MockitoOldcoreRule.USER_CLASS); assertEquals(0, userObject.getNumber()); assertEquals("user1 first name", userObject.getStringValue("first_name")); assertEquals("user1 last name", userObject.getStringValue("last_name")); assertEquals("user1@email.ext", userObject.getStringValue("email")); assertEquals(1, userObject.getIntValue("active")); }
private Date getDate(String key, FilterEventParameters parameters, Date def) { return get(Date.class, key, parameters, def); }
UserInstanceOutputFilterStream extends AbstractBeanOutputFilterStream<UserInstanceOutputProperties> implements UserInstanceOutputFilter { private Date getDate(String key, FilterEventParameters parameters, Date def) { return get(Date.class, key, parameters, def); } }
UserInstanceOutputFilterStream extends AbstractBeanOutputFilterStream<UserInstanceOutputProperties> implements UserInstanceOutputFilter { private Date getDate(String key, FilterEventParameters parameters, Date def) { return get(Date.class, key, parameters, def); }  }
UserInstanceOutputFilterStream extends AbstractBeanOutputFilterStream<UserInstanceOutputProperties> implements UserInstanceOutputFilter { private Date getDate(String key, FilterEventParameters parameters, Date def) { return get(Date.class, key, parameters, def); }  @Override void close(); @Override void beginWiki(String name, FilterEventParameters parameters); @Override void endWiki(String name, FilterEventParameters parameters); @Override void beginUser(String name, FilterEventParameters parameters); @Override void endUser(String name, FilterEventParameters parameters); @Override @Deprecated void beginGroup(String name, FilterEventParameters parameters); @Override void beginGroupContainer(String name, FilterEventParameters parameters); @Override @Deprecated void endGroup(String name, FilterEventParameters parameters); @Override void endGroupContainer(String name, FilterEventParameters parameters); @Override void onGroupMemberUser(String name, FilterEventParameters parameters); @Override void onGroupMemberGroup(String name, FilterEventParameters parameters); }
UserInstanceOutputFilterStream extends AbstractBeanOutputFilterStream<UserInstanceOutputProperties> implements UserInstanceOutputFilter { private Date getDate(String key, FilterEventParameters parameters, Date def) { return get(Date.class, key, parameters, def); }  @Override void close(); @Override void beginWiki(String name, FilterEventParameters parameters); @Override void endWiki(String name, FilterEventParameters parameters); @Override void beginUser(String name, FilterEventParameters parameters); @Override void endUser(String name, FilterEventParameters parameters); @Override @Deprecated void beginGroup(String name, FilterEventParameters parameters); @Override void beginGroupContainer(String name, FilterEventParameters parameters); @Override @Deprecated void endGroup(String name, FilterEventParameters parameters); @Override void endGroupContainer(String name, FilterEventParameters parameters); @Override void onGroupMemberUser(String name, FilterEventParameters parameters); @Override void onGroupMemberGroup(String name, FilterEventParameters parameters);  }