@Test public void shouldFailWhenEmailIsProvidedButNotEndDate() throws OperationException { DocumentModel doc = session.getDocument(new PathRef("/src")); assertNotNull(doc.getACP()); assertNull(doc.getACP().getACL("local")); ctx.setInput(doc); Map<String, Object> params = getParametersForAddOperation(null, null, "johndoe@nuxeo.com", "Write", null, null, null, false, false, null); try { automationService.run(ctx, AddPermission.ID, params); fail(); } catch (IllegalParameterException e) { String expectedMsg = "'end' parameter must be set when adding a permission for an 'email'"; assertEquals(expectedMsg, e.getOriginalMessage()); verifyZeroInteractions(userManager); } }
@OperationMethod(collector = DocumentModelCollector.class) public DocumentModel run(DocumentModel doc) { validateParameters(); addPermission(doc); return doc; }
AddPermission { @OperationMethod(collector = DocumentModelCollector.class) public DocumentModel run(DocumentModel doc) { validateParameters(); addPermission(doc); return doc; } }
AddPermission { @OperationMethod(collector = DocumentModelCollector.class) public DocumentModel run(DocumentModel doc) { validateParameters(); addPermission(doc); return doc; }  }
AddPermission { @OperationMethod(collector = DocumentModelCollector.class) public DocumentModel run(DocumentModel doc) { validateParameters(); addPermission(doc); return doc; }  @OperationMethod(collector = DocumentModelCollector.class) DocumentModel run(DocumentModel doc); @OperationMethod(collector = DocumentModelCollector.class) DocumentModel run(DocumentRef docRef); }
AddPermission { @OperationMethod(collector = DocumentModelCollector.class) public DocumentModel run(DocumentModel doc) { validateParameters(); addPermission(doc); return doc; }  @OperationMethod(collector = DocumentModelCollector.class) DocumentModel run(DocumentModel doc); @OperationMethod(collector = DocumentModelCollector.class) DocumentModel run(DocumentRef docRef); static final String ID; static final String NOTIFY_KEY; static final String COMMENT_KEY; static final String ALLOW_VIRTUAL_USER; }