Package it.tidalwave.util.mock
Class MockAsFactory
java.lang.Object
it.tidalwave.util.mock.MockAsFactory
A provider of static factory methods for creating mocks with
As
support.- Author:
- Fabrizio Giudici
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends As>
TmockWithAs
(Class<T> clazz) Creates a mock with Mockito that fully supportsAs
.static <T extends As>
TmockWithAs
(Class<T> clazz, Collection<Object> roles) Creates a mock with Mockito that fully supportsAs
.
-
Constructor Details
-
MockAsFactory
public MockAsFactory()
-
-
Method Details
-
mockWithAs
Creates a mock with Mockito that fully supportsAs
.- Parameters:
clazz
- the mock class- Returns:
- the mock
- Since:
- 3.2-ALPHA-3 (refactored)
-
mockWithAs
@Nonnull public static <T extends As> T mockWithAs(@Nonnull Class<T> clazz, @Nonnull Collection<Object> roles) Creates a mock with Mockito that fully supportsAs
. This method doesn't callOwnerRoleFactoryProvider.getInstance()
.- Parameters:
clazz
- the mock classroles
- a collection of roles or factories for roles- Returns:
- the mock
- Since:
- 3.2-ALPHA-3 (refactored)
-