@Test public void shouldCallWithParameters() throws OperationException { final String path = "/default-domain"; OperationContext ctx = new OperationContext(session); Map<String, Object> params = new HashMap<>(); params.put("path", path); DocumentModel doc = (DocumentModel) automationService.run(ctx, SampleOperation.ID, params); assertEquals(path, doc.getPathAsString()); }
@OperationMethod public DocumentModel run() { if (StringUtils.isBlank(path)) { return session.getRootDocument(); } else { return session.getDocument(new PathRef(path)); } }
SampleOperation { @OperationMethod public DocumentModel run() { if (StringUtils.isBlank(path)) { return session.getRootDocument(); } else { return session.getDocument(new PathRef(path)); } } }
SampleOperation { @OperationMethod public DocumentModel run() { if (StringUtils.isBlank(path)) { return session.getRootDocument(); } else { return session.getDocument(new PathRef(path)); } }  }
SampleOperation { @OperationMethod public DocumentModel run() { if (StringUtils.isBlank(path)) { return session.getRootDocument(); } else { return session.getDocument(new PathRef(path)); } }  @OperationMethod DocumentModel run(); }
SampleOperation { @OperationMethod public DocumentModel run() { if (StringUtils.isBlank(path)) { return session.getRootDocument(); } else { return session.getDocument(new PathRef(path)); } }  @OperationMethod DocumentModel run(); static final String ID; }