Mockspresso
The main interface returned from a MockspressoBuilder. It implements MockspressoInstance but under the hood, the instance it implements is lazily initiated and doesn't become ensured/immutable until its dependencies are accessed.
IMPORTANT: Calling any of the MockspressoProperties methods after the instance has already been ensured will throw errors at runtime.
Functions
Adds a DynamicObjectMaker to this MockspressoInstance. A DynamicObjectMaker gets a chance to supply any un-cached/undefined dependency before the request goes to the FallbackObjectMaker. This enables mockspresso plugins supply dependencies based on properties other than concrete types (i.e. generic types, class annotations, etc.). It also allows for "default" instances for bindings, which can be overridden by an explicit dependency.
Returns a new MockspressoBuilder using this Mockspresso instance as a parent.
Ensure the MockspressoInstance is initialized and all onSetup commands have been invoked
Find an existing dependency in this mockspresso instance. If the dependency hasn't been cached or constructed then it will be generated on the fly and cached from that point forward. If the binding hasn't been declared in this mockspresso instance, then a fallback will be generated.
Register a request to create a real object of type implementationToken bound in the mockspresso graph with key. The supplied interceptor lambda will be called when the real object is created and allows the test code to wrap the newly constructed real object before it's used. This enables the mock-support plugins to include spy support.
Add a callback that will fire when the MockspressoInstance is fully instantiated/ensured.
Add a callback that will fire when/if the MockspressoInstance is eventually torn down. (Automatic tear-down is not supported by default but can be configured using plugins).
Invokes all onTeardown commands for this and all parent Mockspresso instances