Ensure lazy initialisation in ConfigurableEmbedder.configuredEmbedder()

Description

I stumbled upon a beheavior of this method:

It always calls these methods when being called:

This had some unexpected side effects for me. For example I am logging which steps are being used. Since I call "configuredEmbeder()" multiple times, the method "stepsFactory()" is called multiple times. Even if I use just one instance of embedder it is called many times since the JBehave framework calls "configuredEmbedder()" many times.

Maybe it would be good if there is another method added to "org.jbehave.core.ConfigurableEmbedder" called "configureEmbedder" which actually configures the embedder every time when it is called.

But the method "configuredEmbedder" should maybe be implemented with lazy initialization, so that the calls in its method are just executed once. I tried this in the class which I extend from "JUnitStories". But then the meta-filtering does not work for some strange reason. So I could not find a solution for this.

Assignee

Mauro Talevi

Reporter

Otto Diesel

Labels

None

Components

Fix versions

Affects versions

Priority

Minor
Configure