我刚开始学习activiti,想写一个单元测试来看看如何调用api部署流程和启动流程,现在单元测试怎么都跑不起来,希望熟悉activiti的朋友能够指点一下,谢谢啦!
单元测试代码如下:
public class ProcessTestSRRProcess { private String filename = "D:\\mcgrady\\workspaces-ActivitiDemo\\MyFirstActivitiDemo\\src\\main\\resources\\diagrams\\SSRProcess.bpmn"; @Rule public ActivitiRule activitiRule = new ActivitiRule(); @Test public void startProcess() throws Exception { //创建ProcessEngine实例 ProcessEngine processEngine= ProcessEngineConfiguration.createStandaloneInMemProcessEngineConfiguration() .buildProcessEngine(); //部署流程 RuntimeService runtimeService= processEngine.getRuntimeService(); RepositoryService repositoryService= processEngine.getRepositoryService(); repositoryService.createDeployment().addClasspathResource(filename).deploy(); //启动流程 ProcessInstance processInstance= runtimeService.startProcessInstanceById("SRRProcess"); assertNotNull(processInstance.getId()); System.out.println("id "+processInstance.getId()+" "+processInstance.getProcessDefinitionId()); } }
启动JUnit开始调试,在第一行代码ProcessEngine processEngine= ProcessEngineConfiguration.createStandaloneInMemProcessEngineConfiguration()
.buildProcessEngine();
这里就报错了,错误信息如下图:
从这个错来看是slf4j日志依赖包没有.
这个问题解决了吗 ? 我也遇到了 ,求赐教