Details
-
Type: New Feature
-
Status: Open
-
Priority: Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: Guice Support, Pico Support, (1)
Spring Support -
Labels:None
-
Number of attachments :
Description
Meta tags can be injected into step methods. They can't be injected into step-pojo constructors, nor in any capacity to components that are themselves injectable into step-pojo constructors.
Workaround people have to do: accept the meta-tag into the step-pojo's step method and hand it to wherever needs.
In our particular case, Page objects are being made by a DI container, and it would be better separation of concerns to have meta tags injected where they are needed, and not in the steps class (which only passes them on).
The senior developer in question wishes, in lieu of something better, that StoryRunner.RunContext.Meta was statically available (on a thread local) and that page objects could pull it when they need it. That's a breach of IoC of course, but you get why he wishes for it.
What are the usecases you are trying to address?
What one may do is to define an interface MetaEnabled that steps classes can optionally implement and the current Meta can be passed on to the instance (ah the good ol' Avalon days are coming back).
You can't have any parsed data (including Meta) injected into the constructors of the steps classes without doing very complicated back flipping and throwing IoC out the window.