import org.camunda.bpm.engine.runtime.ProcessInstance; import org.camunda.bpm.engine.test.Deployment; import org.camunda.bpm.engine.test.ProcessEngineRule; import static org.assertj.core.api.Assertions.assertThat; import static org.camunda.bpm.engine.test.assertions.ProcessEngineAssertions.assertThat; import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.*; import static org.junit.Assert.assertEquals; import org.junit.Rule; import org.junit.Test; public class FinalTest { @Rule public ProcessEngineRule rule = new ProcessEngineRule(); @Test @Deployment(resources = { "testProcess.bpmn" }) public void executeProcess() { ProcessInstance processInstance = runtimeService().startProcessInstanceByKey("BudgetDeclaration"); assertThat(processInstance).isActive(); assertThat(processInstanceQuery().count()).isEqualTo(1); assertThat(task(processInstance)).isAssignedTo("task1"); assertThat(task(processInstance)).isNotNull(); complete(task(processInstance)); assertThat(task(processInstance)).isAssignedTo("task2"); assertThat(task(processInstance)).isNotNull(); complete(task(processInstance)); assertThat(processInstance).isEnded(); } }