-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add spring test support for CallActivity mocking #104
Comments
Since I also think this would be a very useful feature, I hat a take at this. My intermediate result is in https://github.com/fml2/camunda-bpm-mockito/tree/feature/Mock-CallActivity-in-Spring-context. The usage would be:
Please gurus look at this and tell me whether the approach is a promising one. For now, I can't figure out how to get a SingletonBeanRegistry (used in my class) given an ApplicationContext (usually available in a spring based test). |
I appreciate your contribution. Unfortunately, I was having trouble reviewing this ... I am locally not able to build this ... I guess this is some problem on my machine, please give me a day or two to fix this. |
Have you had a chance to look at this? |
Following code is not working for Spring tests:
CallActivityMock deployFlowMock = ProcessExpressions.registerCallActivityMock(testDeployFlow).onExecutionAddVariable("var", "val"); deployFlowMock.deploy(processEngine);
As I think it happens because of using different contexts for mocks. I went deep to the mocking code and saw that all stubs are registered with
Mocks.register(name, instance);
and it puts into static ThreadLocal map. But Spring doesn't see this things.Could you provide an API which will register mocks depends on current context (which we can define with annotation, for example)?
The text was updated successfully, but these errors were encountered: