assertFalse(response.getDocid(), response.isValid());
}
}
public void testAuthorizeDocids() throws Exception {
Session session = connector.login();
List<String> docIds = getDocIds(session);
assertEquals(5, docIds.size());
// Try to construct an invalid docId that's still
// syntactically valid. It should be authorized since it
// won't appear in the security view.
StringBuilder id = new StringBuilder(docIds.get(2));
int slash = id.lastIndexOf("/");
id.replace(slash + 1, id.length() - 1, "12345678901234567890123456789012");
docIds.add(4, id.toString());
NotesAuthorizationManager manager =
(NotesAuthorizationManager) session.getAuthorizationManager();
Collection<AuthorizationResponse> responseList = manager.authorizeDocids(
docIds, new SimpleAuthenticationIdentity(username));
assertEquals(6, responseList.size());
for (AuthorizationResponse response : responseList) {
assertTrue(response.getDocid(), response.isValid());