I am trying to create configuration class for unit testing but it seems like it fails to locate prcess_defination_file_bpmn20.xml
floowing is the Configuration class:
Blockquote
@ExtendWith(FlowableSpringExtension.class)
//@ExtendWith(SpringExtension.class)
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest
@Configuration
@ActiveProfiles(“test”)
public class SpringJunitJupiterTest
{
@Autowired
ApplicationContext appContext;
@Autowired
public ProcessEngine processEngine;
@Autowired
public RuntimeService runtimeService;
@Autowired
public TaskService taskService;
@Test
@Deployment(resources = “processes/process.bpmn20.xml”)
public void simpleProcessTest(FlowableTestHelper flowableTestHelper, @DeploymentId String deploymentId, ProcessEngine extensionProcessEngine)
{
runtimeService.startProcessInstanceByKey(“process_id”);
Task task = taskService.createTaskQuery().singleResult();
assertThat(task.getName()).isEqualTo("Approve orReject Request");
taskService.complete(task.getId());
assertThat(runtimeService.createProcessInstanceQuery().list()).isEmpty();
assertThat(flowableTestHelper.getDeploymentIdFromDeploymentAnnotation())
.isEqualTo(deploymentId)
.isNotNull();
assertThat(flowableTestHelper.getProcessEngine())
.as("Spring injected process engine")
.isSameAs(processEngine)
.as("Extension injected process engine")
.isSameAs(processEngine);
assertThat(flowableTestHelper.getMockSupport()).as("mockSupport").isNotNull();
ProcessDefinition deployedProcessDefinition = repositoryService.createProcessDefinitionQuery().deploymentId(deploymentId).singleResult();
assertThat(deployedProcessDefinition).isNotNull();
assertThat(deployedProcessDefinition.getId())
.as("Deployed ProcessDefinition")
.isEqualTo(task.getProcessDefinitionId());
}
}
Blockquote