-
Notifications
You must be signed in to change notification settings - Fork 2
/
TestSpringEvents.java
30 lines (23 loc) · 1.05 KB
/
TestSpringEvents.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package org.camunda.bpm.example.events;
import org.camunda.bpm.engine.RuntimeService;
import org.camunda.bpm.engine.runtime.ProcessInstance;
import org.camunda.bpm.spring.boot.starter.test.helper.AbstractProcessEngineRuleTest;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareTests.*;
@SpringBootTest(properties = "camunda.bpm.metrics.enabled=false")
@RunWith(SpringRunner.class)
public class TestSpringEvents extends AbstractProcessEngineRuleTest {
@Autowired
public RuntimeService runtimeService;
@Test
public void shouldExecuteHappyPath() {
ProcessInstance pi = runtimeService.startProcessInstanceByKey("my-project-process");
assertThat(pi).isStarted().isWaitingAt("say-hello-task");
complete(task());
assertThat(pi).hasPassed("say-hello-task").isEnded();
}
}