NotesDatabaseMock configDatabase = (NotesDatabaseMock) session
.getDatabase(connectorSession.getServer(),
connectorSession.getDatabase());
NotesDocumentMock databaseDocument = new NotesDocumentMock();
databaseDocument.addItem(new NotesItemMock("name", NCCONST.DITM_DBNAME,
"type", NotesItem.TEXT, "values", "JediTrainingManuals.nsf"));
databaseDocument.addItem(new NotesItemMock("name",
NCCONST.DITM_REPLICAID, "type", NotesItem.TEXT,
"values", "jtmreplicaid0123"));
databaseDocument.addItem(new NotesItemMock("name", NCCONST.DITM_SERVER,
"type", NotesItem.TEXT, "values", "JediServer"));
databaseDocument.addItem(new NotesItemMock("name",
NCCONST.NCITM_DBPERMITUSERS, "type", NotesItem.TEXT,
"values", "cn=anakin skywalker/ou=tests/o=tests"));
configDatabase.addDocument(databaseDocument, NCCONST.VIEWDATABASES,
NCCONST.VIEWSECURITY);
NotesDatabaseMock notesDatabase = new NotesDatabaseMock(
"JediServer", "JediTrainingManuals.nsf", "jtmreplicaid0123");
((NotesSessionMock) session).addDatabase(notesDatabase);
NotesACLMock acl = new NotesACLMock();
acl.addAclEntry(new NotesACLEntryMock(
"cn=Anakin Skywalker/ou=Tests/o=Tests", NotesACLEntry.TYPE_PERSON,
NotesACL.LEVEL_AUTHOR, "[tacticsexpert]"));
acl.addAclEntry(new NotesACLEntryMock("masters",
NotesACLEntry.TYPE_PERSON_GROUP, NotesACL.LEVEL_AUTHOR,
"[holderofopinions]"));
notesDatabase.setACL(acl);
databaseDocument = new NotesDocumentMock();
databaseDocument.addItem(new NotesItemMock("name", NCCONST.DITM_DBNAME,
"type", NotesItem.TEXT, "values", "testDb.nsf"));
databaseDocument.addItem(new NotesItemMock("name",
NCCONST.DITM_REPLICAID, "type", NotesItem.TEXT,
"values", "testdb_replicaid"));
databaseDocument.addItem(new NotesItemMock("name", NCCONST.DITM_SERVER,
"type", NotesItem.TEXT, "values", "server"));
databaseDocument.addItem(new NotesItemMock("name",
NCCONST.NCITM_DBPERMITGROUPS, "type", NotesItem.TEXT,
"values", "jedi"));
configDatabase.addDocument(databaseDocument, NCCONST.VIEWDATABASES,
NCCONST.VIEWSECURITY);