cancel
Showing results for 
Search instead for 
Did you mean: 

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

xingjl6280
Champ in-the-making
Champ in-the-making

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 ACCEPTED ANSWER

cjose
Elite Collaborator
Elite Collaborator

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 answer in original post

2 REPLIES 2

cjose
Elite Collaborator
Elite Collaborator

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
Champ in-the-making
Champ in-the-making

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