Hi ,
I am new in camunda and i have to write the junit test .can you please help me 2 write the junit test .
please find my code below code and attached bpmn file and help me to complete the junit .
public class InMemoryH2Test {
@ClassRule
@Rule
public static ProcessEngineRule rule = TestCoverageProcessEngineRuleBuilder.create().build();
private static final String PROCESS_DEFINITION_KEY = “cancelApplication”;
// private static final String PROCESS_DEFINITION_KEY1 = “cancelApplicationNets@release@”;
// @Rule
//public TestCoverageProcessEngineRule rule1 = TestCoverageProcessEngineRuleBuilder.create().withDetailedCoverageLogging().build();
@Rule
public ProcessEngineRule processEngineRule = new ProcessEngineRule();
static {
LogFactory.useSlf4jLogging(); // MyBatis
}
@Before
public void setup() {
init(rule.getProcessEngine());
}
/**
- Just tests if the process definition is deployable.
*/
@Test
@Deployment(resources = “cancelApplication.bpmn”)
public void testParsingAndDeployment() {
// nothing is done here, as we just want to check for exceptions during deployment
}
@Test
@Deployment(resources = “cancelApplication.bpmn”)
public void testHappyPath() {
//ProcessInstance processInstance = processEngine().getRuntimeService().startProcessInstanceByKey(PROCESS_DEFINITION_KEY);
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("sendResponse", true);
System.out.print("Add variable " + variables );
ProcessInstance processInstance = runtimeService().startProcessInstanceByKey(PROCESS_DEFINITION_KEY,variables);
cancelApplication.bpmn (13.1 KB)