Abstract implementation of {@link Embeddable} which allows to configure the{@link Embedder} used to run the stories, using the {@link Configuration} andthe {@link InjectableStepsFactory} specified.
The instances of the {@link Configuration} and the{@link InjectableStepsFactory} can be provided either via the{@link #useConfiguration(Configuration)} and{@link #useStepsFactory(InjectableStepsFactory)} methods or overriding the{@link #configuration()} and {@link #stepsFactory()} methods.
If overriding the {@link #configuration()} method and providing an{@link InjectableStepsFactory} which requires a {@link Configuration}, then care must be taken to avoid re-instantiating the {@link Configuration}. E.g.:
{@code}public Configuration configuration() if ( super.hasConfiguration() ){ return super.configuration(); } return new MostUsefulConfiguration()...; }
Note that no defaults are provided by this implementation. If no values are set by the subclasses, then null
values are passed to the configured {@link Embedder}, which is responsible for setting the default values.
Typically, users that use JUnit will find it easier to extend other implementations, such as {@link JUnitStory} or {@link JUnitStories}, which implement the {@link #run()} using the configured {@link Embedder} andannotate it with JUnit's annotations.
|
|
|
|
|
|