Package spock.mock
package spock.mock
-
ClassDescriptionAutomatically attaches detached mocks
DetachedMockFactory
to a Specification.This factory allows the creations of mocks outside of aSpecification
, e.g., in a Spring configuration.Settings passed to theIMockMaker
and created explicitly for the requested mock maker.Base interface for Java based mocks seeMockingApi
orDetachedMockFactory
for more examples.Spock's mocking API primarily consists of the following factory methods: Mock() Creates a general-purpose test double that supports both stubbing and mocking. Stub() Creates a test double that supports stubbing but not mocking. Spy() Creates a test double that, by default, delegates all calls to a real object.Represents the ID of anIMockMaker
.Provides constants and factory methods for known built-inIMockMaker
implementations.