Skip to content
Discussion options

You must be logged in to vote

Dependency injection with Pico container is scoped to the scenarios life cycle. This ensures that state is not accidentally shared between scenarios. But without an active scenario there is also no dependency injection context to inject from. This is something I've been wanting to improve for a while now but there are other problems to solve first.

Now you didn't mention what your concrete problem is, but here are some options:

  1. Use a @Before hook and implement the exactly once semantics yourself.
  2. Switch to cucumber-spring and create a @Component with a @EventListener(ContextStartedEvent.class) annotated method. This will allow you to access the application scoped beans and do any additio…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@chabala
Comment options

@chabala
Comment options

@mpkorstanje
Comment options

@chabala
Comment options

Answer selected by chabala
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants