@Test public void shouldCallTheOperation() throws OperationException { OperationContext ctx = new OperationContext(session); DocumentModel doc = (DocumentModel) automationService.run(ctx, SampleOperation.ID); assertEquals("/", 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; }