Details
Description
When creating a JUnitStories class, the overridden configuration method is no longer executed starting in JBehave 3.9.2.
I also tested this with 3.9.3, 3.9.5 and 4.0-beta-11 and the issue persists. Only by changing the dependency version in my POM back to 3.9.1 does the method override correctly again.
I have attached my StoryReporter class, the abstract class where the issue presents when version >= 3.9.2 and an example Embeddable JUnitRunner class that inherits from it.
MyStoryReporter.class is simply a Reporter that prints information to System.out where every callback prints a line starting with [JBEHAVE] and emits whatever information is available:
You can run any story file from resources and see that the StoryReporter does not get used unless you are on a version prior to 3.9.2. You can also add a breakpoint in configuration and see that the breakpoint will be hit in 3.9.1 but is never hit in 3.9.2 and later.
Activity
Field | Original Value | New Value |
---|---|---|
Attachment | pom.patch [ 66683 ] |
Resolution | Not A Bug [ 6 ] | |
Fix Version/s | 3.9.2 [ 20180 ] | |
Status | Open [ 1 ] | Resolved [ 5 ] |
Fix Version/s | 3.9.2 [ 20180 ] | |
Fix Version/s | 3.9.6 [ 20672 ] |
Yes, this is a side effect of
JBEHAVE-1009. The ConfigurableEmbedder now uses the configuration() method lazily only if there is no other configuration set.To override with your instance of Configuration, you can use the #useConfiguration() method in the constructor of the class inheriting from JUnitStories.
The CoreStories in the core examples show how to configure using the configuration() method.
If you still have problems, please provide a fully working example buildable and executable by command-line (either a zip or a git repo) so we can reproduce your behaviour.