Class ConfigurableEmbedder
- All Implemented Interfaces:
Embeddable
- Direct Known Subclasses:
JupiterStories
Abstract implementation of Embeddable
which extends InjectableEmbedder
to allow the configuration using the Configuration
and
the InjectableStepsFactory
specified.
The instances of the Configuration
and the
InjectableStepsFactory
can be provided either via the
useConfiguration(Configuration)
and
useStepsFactory(InjectableStepsFactory)
methods or overriding the
configuration()
and stepsFactory()
methods.
If overriding the configuration()
method and providing an
InjectableStepsFactory
which requires a Configuration
, then
care must be taken to avoid re-instantiating the Configuration
. E.g.:
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 Embedder
, which is responsible for setting the default
values.
Typically, users that use JUnit will find it easier to extend other
implementations, such as JUnitStories
which
implement the Embeddable.run()
using the configured Embedder
and
annotate it with JUnit's annotations.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
void
useConfiguration
(Configuration configuration) void
useStepsFactory
(InjectableStepsFactory stepsFactory) Methods inherited from class org.jbehave.core.InjectableEmbedder
injectedEmbedder, useEmbedder
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.jbehave.core.Embeddable
run
-
Constructor Details
-
ConfigurableEmbedder
public ConfigurableEmbedder()
-
-
Method Details
-
useConfiguration
-
configuration
-
hasConfiguration
public boolean hasConfiguration() -
useStepsFactory
-
stepsFactory
-
hasStepsFactory
public boolean hasStepsFactory() -
configuredEmbedder
-