public class PartialMockObject<T> extends MockObject<T> implements PartialMock<T>
alwaysMatchingBehaviorDefiningInvocations, chainedMocksPerName, matchingInvocationBuilderThreadLocal, mockedType, mockProxy, name, oneTimeMatchingBehaviorDefiningInvocations, scenarioThreadLocal| Constructor and Description |
|---|
PartialMockObject(Class<?> mockedType,
Object testObject)
Creates a mock of the given type with un-capitalized type name + Mock as name, e.g. myServiceMock.
|
PartialMockObject(Object mockPrototype,
Object testObject)
Creates a mock of the same type as the given mock prototype with un-capitalized type name + Mock as name, e.g. myServiceMock.
|
PartialMockObject(String name,
Class<?> mockedType,
Object testObject)
Creates a mock of the given type for the given scenario.
|
PartialMockObject(String name,
Object mockedInstance,
Object testObject)
Creates a mock of the same type as the given mock prototype with the given name.
|
| Modifier and Type | Method and Description |
|---|---|
protected MockProxy<T> |
createMockProxy() |
T |
stub()
Stubs out (removes) the behavior of the method when the invocation following
this call matches the observed behavior.
|
assertInvoked, assertInvokedInSequence, assertNotInvoked, createAlwaysMatchingBehaviorDefiningInvocations, createAlwaysMatchingBehaviorDefiningMatchingInvocationHandler, createAssertInvokedInSequenceVerifyingMatchingInvocationHandler, createAssertInvokedVerifyingMatchingInvocationHandler, createAssertNotInvokedVerifyingMatchingInvocationHandler, createChainedMock, createMatchingInvocationBuilder, createOneTimeMatchingBehaviorDefiningInvocations, createOneTimeMatchingBehaviorDefiningMatchingInvocationHandler, createScenario, getCurrentScenario, getMatchingInvocationBuilder, getMock, getMockedType, getName, getObjectToInject, getObjectToInjectType, getScenario, oncePerforms, onceRaises, onceRaises, onceReturns, performs, raises, raises, resetBehavior, returns, startMatchingInvocationclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitassertInvoked, assertInvokedInSequence, assertNotInvoked, getMock, oncePerforms, onceRaises, onceRaises, onceReturns, performs, raises, raises, resetBehavior, returnspublic PartialMockObject(Object mockPrototype, Object testObject)
mockPrototype - The instance that will be wrapped with a proxy, use the raw type when mocking generic types, not nulltestObject - The test object, not nullpublic PartialMockObject(String name, Object mockedInstance, Object testObject)
name - The name of the mock, e.g. the field-name, null for the defaultmockedInstance - The instance that will be wrapped with a proxy, use the raw type when mocking generic types, not nulltestObject - The test object, not nullpublic PartialMockObject(Class<?> mockedType, Object testObject)
mockedType - The mock type that will be proxied, use the raw type when mocking generic types, not nulltestObject - The test object, not nullpublic PartialMockObject(String name, Class<?> mockedType, Object testObject)
name - The name of the mock, e.g. the field-name, null for the defaultmockedType - The mock type that will be proxied, use the raw type when mocking generic types, not nulltestObject - The test object, not nullpublic T stub()
stub in interface PartialMock<T>protected MockProxy<T> createMockProxy()
createMockProxy in class MockObject<T>Copyright © 2016. All Rights Reserved.