Could ActivitiRule for JUnit4 work without activiti.cfg.xml?

cancel
Showing results for 
Search instead for 
Did you mean: 
xingjl6280
Member II

Could ActivitiRule for JUnit4 work without activiti.cfg.xml?

Jump to solution

I'm using Springboot to set up my project and @EnableAutoConfiguration annotation. Configurations like datasource, pooling are in application.properties.

But i got error for my test class that activiti failed to find activiti.cfg.xml.

I use @Rule annotation 

@Rule

public ActivitiRule activitiRule=new ActivitiRule();

Please kindly advise how could I proceed.

1 Solution

Accepted Solutions
cjose
Senior Member II

Re: Could ActivitiRule for JUnit4 work without activiti.cfg.xml?

Jump to solution

This has been asked previously on stack-overflow at java - Exception when building the ApplicationContext for a JUnit test in Activiti with Spring Boot ... where there is a suggested solution. Please note that I haven't tried this by myself, however looking at it it should work! The question is do you really need to use ActivitiRule? Any reason why you don't want to use the test approach used in  activiti-spring-boot-samples/spring-boot-sample-basic at master · Alfresco/activiti-spring-boot-samp... ?

Cheers,

Ciju

View solution in original post

2 Replies
cjose
Senior Member II

Re: Could ActivitiRule for JUnit4 work without activiti.cfg.xml?

Jump to solution

This has been asked previously on stack-overflow at java - Exception when building the ApplicationContext for a JUnit test in Activiti with Spring Boot ... where there is a suggested solution. Please note that I haven't tried this by myself, however looking at it it should work! The question is do you really need to use ActivitiRule? Any reason why you don't want to use the test approach used in  activiti-spring-boot-samples/spring-boot-sample-basic at master · Alfresco/activiti-spring-boot-samp... ?

Cheers,

Ciju

xingjl6280
Member II

Re: Could ActivitiRule for JUnit4 work without activiti.cfg.xml?

Jump to solution

Thank you so much Ciju, for such a quick response. This addressed my query.