Open britter opened 10 years ago
@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 SpringJUnit4ClassRunner
to run its stories (see example, but my IDE doesn't show the steps beautifully in its test result navigator. So I want to use jbehave-junit-runner
, which has worked beautifully for me with statically configured tests. But I can't use it without Spring autowiring.
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).