-
Notifications
You must be signed in to change notification settings - Fork 53
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
Create an example on how to inject members into a test using spring #62
Comments
@britter Does it make sense to move the examples to another project (#54) within the same repository (similar to https://github.com/codecentric/zucchini) before #62? |
@visusnet makes sense to me! |
What's the state of the art now? I have an exploratory project that uses |
Any news about this? or document about the best practices to put this in place? I am currently trying it and it's not very strait forward. The @rule from Spring sounds promising but I couldn't make it work yet |
We had quite a few requests on how to use the jbehave-junit-runner together with spring. The problem is, that both, our library and spring test provide a JUnitRunner and only one runner can be declared per test.
We should document a way to inject members into a jbehave junit test using spring. The easiest way would probably be, to create an
ApplicationContext
in the@Before
hock by hand, get anAutowireCapableFactoryBean
from there and then callautowireBean(Object)
passing in the this reference (see also: http://stackoverflow.com/questions/3813588/how-to-inject-dependencies-into-a-self-instantiated-object-in-spring).The text was updated successfully, but these errors were encountered: