Sometimes scopes in JBehave-based tests of configured injections are different to the original application configurations. Let's say we have a webapplication that configures some injections as a session-based scope. If we now want to test parts of the application without a real servlet context we sometimes need a diffrent scope for some of theses injections. Usefull scopes in jbehave-based tests are scenario- and story-scopes. Naturally we can use @Before/After-Scenario/Story Annotations to handle the the reset manually, but it is much easier and cleaner to write such things as
bind(Interface.class).to(Implementation.class).in(JBehaveScopes.SCENARIO);
You can investigate an example here : ServletWithScopeTest.java