Represents the currently executing scenario, allowing information to be shared between Cucumber step definitions (for unit- or integration- scoped), and also for integration tests.
Two types of information are available:
- First, there are the domain services, provided using the {@link #service(Class) method}. If running at unit-scope, then these will most likely be mocked services (and not all services will necessarily be available). If running at integration-scope, then these will most likely be real instances, eg wired to the backend database.
- Second, there is a map of identified objects. This is predominantly for Cucumber step definitions (either unit- or integration-scoped), such that information can be passed between steps in a decoupled fashion.
When instantiated, this object binds itself to the current thread (using a {@link ThreadLocal}).
Subclasses may tailor the world for specific types of tests; for example the IntegrationScenarioExecution provides additional support for fixtures and transaction management, used both by integration-scoped specs and by integration tests.