public class MockKDsl
DSL entry points.
| Modifier and Type | Field and Description |
|---|---|
static MockKDsl |
INSTANCE
DSL entry points.
|
| Modifier and Type | Method and Description |
|---|---|
void |
internalClearAllMocks(boolean answers,
boolean recordedCalls,
boolean childMocks,
boolean regularMocks,
boolean objectMocks,
boolean staticMocks,
boolean constructorMocks,
boolean verificationMarks,
boolean exclusionRules) |
void |
internalClearConstructorMockk(kotlin.reflect.KClass[] classes,
boolean answers,
boolean recordedCalls,
boolean childMocks,
boolean verificationMarks,
boolean exclusionRules)
Clear constructor mocks.
|
void |
internalClearMocks(java.lang.Object firstMock,
java.lang.Object[] mocks,
boolean answers,
boolean recordedCalls,
boolean childMocks,
boolean verificationMarks,
boolean exclusionRules)
Resets information associated with mock
|
void |
internalClearObjectMockk(java.lang.Object[] objects,
boolean answers,
boolean recordedCalls,
boolean childMocks,
boolean verificationMarks,
boolean exclusionRules)
Clear object mocks.
|
void |
internalClearStaticMockk(kotlin.reflect.KClass[] classes,
boolean answers,
boolean recordedCalls,
boolean childMocks,
boolean verificationMarks,
boolean exclusionRules)
Clear static mocks.
|
<T> MockKStubScope<T,T> |
internalCoEvery(kotlin.jvm.functions.Function2<? super io.mockk.MockKMatcherScope,? super kotlin.coroutines.experimental.Continuation<? super T>,? extends java.lang.Object> stubBlock)
Starts a block of stubbing for coroutines. Part of DSL.
|
void |
internalCoExcludeRecords(boolean current,
kotlin.jvm.functions.Function2<? super io.mockk.MockKMatcherScope,? super kotlin.coroutines.experimental.Continuation<? super kotlin.Unit>,? extends java.lang.Object> excludeBlock)
Exclude calls from recording for a suspend block
|
void |
internalCoVerify(Ordering ordering,
boolean inverse,
int atLeast,
int atMost,
int exactly,
long timeout,
kotlin.jvm.functions.Function2<? super io.mockk.MockKVerificationScope,? super kotlin.coroutines.experimental.Continuation<? super kotlin.Unit>,? extends java.lang.Object> verifyBlock)
Verify for coroutines
|
void |
internalCoVerifyAll(boolean inverse,
kotlin.jvm.functions.Function2<? super io.mockk.MockKVerificationScope,? super kotlin.coroutines.experimental.Continuation<? super kotlin.Unit>,? extends java.lang.Object> verifyBlock)
Shortcut for all calls verification
|
void |
internalCoVerifyOrder(boolean inverse,
kotlin.jvm.functions.Function2<? super io.mockk.MockKVerificationScope,? super kotlin.coroutines.experimental.Continuation<? super kotlin.Unit>,? extends java.lang.Object> verifyBlock)
Shortcut for ordered calls verification
|
void |
internalCoVerifySequence(boolean inverse,
kotlin.jvm.functions.Function2<? super io.mockk.MockKVerificationScope,? super kotlin.coroutines.experimental.Continuation<? super kotlin.Unit>,? extends java.lang.Object> verifyBlock)
Shortcut for sequence calls verification
|
void |
internalConfirmVerified(java.lang.Object mocks)
Checks if all recorded calls were verified.
|
<T> MockKStubScope<T,T> |
internalEvery(kotlin.jvm.functions.Function1<? super io.mockk.MockKMatcherScope,? extends T> stubBlock)
Starts a block of stubbing. Part of DSL.
|
void |
internalExcludeRecords(boolean current,
kotlin.jvm.functions.Function1<? super io.mockk.MockKMatcherScope,kotlin.Unit> excludeBlock)
Exclude calls from recording
|
void |
internalInitAnnotatedMocks(java.util.List<? extends java.lang.Object> targets,
boolean overrideRecordPrivateCalls,
boolean relaxUnitFun,
boolean relaxed)
Initializes
|
boolean |
internalIsMockKMock(java.lang.Object mock,
boolean regular,
boolean spy,
boolean objectMock,
boolean staticMock,
boolean constructorMock) |
<T> T |
internalMockkClass(kotlin.reflect.KClass<T> type,
java.lang.String name,
boolean relaxed,
kotlin.reflect.KClass[] moreInterfaces,
boolean relaxUnitFun,
kotlin.jvm.functions.Function1<? super T,kotlin.Unit> block)
Builds a mock for a class. Deprecated
|
void |
internalMockkConstructor(kotlin.reflect.KClass[] classes,
boolean recordPrivateCalls,
boolean localToThread)
Constructor mockk
|
void |
internalMockkObject(java.lang.Object[] objects,
boolean recordPrivateCalls)
Object mockk
|
void |
internalMockkStatic(kotlin.reflect.KClass classes)
Static mockk
|
MockKObjectScope |
internalObjectMockk(java.lang.Object[] objs,
boolean recordPrivateCalls)
Declares object mockk. Deprecated
|
<T> T |
internalSpyk(T objToCopy,
java.lang.String name,
kotlin.reflect.KClass[] moreInterfaces,
boolean recordPrivateCalls,
kotlin.jvm.functions.Function1<? super T,kotlin.Unit> block)
Builds a new spy for specified class. Initializes object via default constructor.
|
MockKStaticScope |
internalStaticMockk(kotlin.reflect.KClass kClass)
Declares static mockk. Deprecated
|
void |
internalUnmockkAll()
Unmockk everything
|
void |
internalUnmockkConstructor(kotlin.reflect.KClass classes)
Cancel constructor mocks.
|
void |
internalUnmockkObject(java.lang.Object objects)
Cancel object mocks.
|
void |
internalUnmockkStatic(kotlin.reflect.KClass classes)
Cancel static mocks.
|
void |
internalVerify(Ordering ordering,
boolean inverse,
int atLeast,
int atMost,
int exactly,
long timeout,
kotlin.jvm.functions.Function1<? super io.mockk.MockKVerificationScope,kotlin.Unit> verifyBlock)
Verifies calls happened in the past. Part of DSL
|
void |
internalVerifyAll(boolean inverse,
kotlin.jvm.functions.Function1<? super io.mockk.MockKVerificationScope,kotlin.Unit> verifyBlock)
Shortcut for all calls verification
|
void |
internalVerifyOrder(boolean inverse,
kotlin.jvm.functions.Function1<? super io.mockk.MockKVerificationScope,kotlin.Unit> verifyBlock)
Shortcut for ordered calls verification
|
void |
internalVerifySequence(boolean inverse,
kotlin.jvm.functions.Function1<? super io.mockk.MockKVerificationScope,kotlin.Unit> verifyBlock)
Shortcut for sequence calls verification
|
public static MockKDsl INSTANCE
DSL entry points.
public <T> T internalSpyk(T objToCopy,
java.lang.String name,
kotlin.reflect.KClass[] moreInterfaces,
boolean recordPrivateCalls,
kotlin.jvm.functions.Function1<? super T,kotlin.Unit> block)
Builds a new spy for specified class. Initializes object via default constructor.
public <T> MockKStubScope<T,T> internalEvery(kotlin.jvm.functions.Function1<? super io.mockk.MockKMatcherScope,? extends T> stubBlock)
Starts a block of stubbing. Part of DSL.
public <T> MockKStubScope<T,T> internalCoEvery(kotlin.jvm.functions.Function2<? super io.mockk.MockKMatcherScope,? super kotlin.coroutines.experimental.Continuation<? super T>,? extends java.lang.Object> stubBlock)
Starts a block of stubbing for coroutines. Part of DSL.
public void internalVerify(Ordering ordering, boolean inverse, int atLeast, int atMost, int exactly, long timeout, kotlin.jvm.functions.Function1<? super io.mockk.MockKVerificationScope,kotlin.Unit> verifyBlock)
Verifies calls happened in the past. Part of DSL
public void internalCoVerify(Ordering ordering, boolean inverse, int atLeast, int atMost, int exactly, long timeout, kotlin.jvm.functions.Function2<? super io.mockk.MockKVerificationScope,? super kotlin.coroutines.experimental.Continuation<? super kotlin.Unit>,? extends java.lang.Object> verifyBlock)
Verify for coroutines
public void internalVerifyOrder(boolean inverse,
kotlin.jvm.functions.Function1<? super io.mockk.MockKVerificationScope,kotlin.Unit> verifyBlock)
Shortcut for ordered calls verification
public void internalVerifyAll(boolean inverse,
kotlin.jvm.functions.Function1<? super io.mockk.MockKVerificationScope,kotlin.Unit> verifyBlock)
Shortcut for all calls verification
public void internalVerifySequence(boolean inverse,
kotlin.jvm.functions.Function1<? super io.mockk.MockKVerificationScope,kotlin.Unit> verifyBlock)
Shortcut for sequence calls verification
public void internalCoVerifyOrder(boolean inverse,
kotlin.jvm.functions.Function2<? super io.mockk.MockKVerificationScope,? super kotlin.coroutines.experimental.Continuation<? super kotlin.Unit>,? extends java.lang.Object> verifyBlock)
Shortcut for ordered calls verification
public void internalCoVerifyAll(boolean inverse,
kotlin.jvm.functions.Function2<? super io.mockk.MockKVerificationScope,? super kotlin.coroutines.experimental.Continuation<? super kotlin.Unit>,? extends java.lang.Object> verifyBlock)
Shortcut for all calls verification
public void internalCoVerifySequence(boolean inverse,
kotlin.jvm.functions.Function2<? super io.mockk.MockKVerificationScope,? super kotlin.coroutines.experimental.Continuation<? super kotlin.Unit>,? extends java.lang.Object> verifyBlock)
Shortcut for sequence calls verification
public void internalExcludeRecords(boolean current,
kotlin.jvm.functions.Function1<? super io.mockk.MockKMatcherScope,kotlin.Unit> excludeBlock)
Exclude calls from recording
current - if current recorded calls should be filtered outpublic void internalCoExcludeRecords(boolean current,
kotlin.jvm.functions.Function2<? super io.mockk.MockKMatcherScope,? super kotlin.coroutines.experimental.Continuation<? super kotlin.Unit>,? extends java.lang.Object> excludeBlock)
Exclude calls from recording for a suspend block
current - if current recorded calls should be filtered outpublic void internalConfirmVerified(java.lang.Object mocks)
Checks if all recorded calls were verified.
public void internalClearMocks(java.lang.Object firstMock,
java.lang.Object[] mocks,
boolean answers,
boolean recordedCalls,
boolean childMocks,
boolean verificationMarks,
boolean exclusionRules)
Resets information associated with mock
public MockKStaticScope internalStaticMockk(kotlin.reflect.KClass kClass)
Declares static mockk. Deprecated
public MockKObjectScope internalObjectMockk(java.lang.Object[] objs, boolean recordPrivateCalls)
Declares object mockk. Deprecated
public <T> T internalMockkClass(kotlin.reflect.KClass<T> type,
java.lang.String name,
boolean relaxed,
kotlin.reflect.KClass[] moreInterfaces,
boolean relaxUnitFun,
kotlin.jvm.functions.Function1<? super T,kotlin.Unit> block)
Builds a mock for a class. Deprecated
public void internalInitAnnotatedMocks(java.util.List<? extends java.lang.Object> targets,
boolean overrideRecordPrivateCalls,
boolean relaxUnitFun,
boolean relaxed)
Initializes
public void internalMockkObject(java.lang.Object[] objects,
boolean recordPrivateCalls)
Object mockk
public void internalUnmockkObject(java.lang.Object objects)
Cancel object mocks.
public void internalClearObjectMockk(java.lang.Object[] objects,
boolean answers,
boolean recordedCalls,
boolean childMocks,
boolean verificationMarks,
boolean exclusionRules)
Clear object mocks.
public void internalMockkStatic(kotlin.reflect.KClass classes)
Static mockk
public void internalUnmockkStatic(kotlin.reflect.KClass classes)
Cancel static mocks.
public void internalClearStaticMockk(kotlin.reflect.KClass[] classes,
boolean answers,
boolean recordedCalls,
boolean childMocks,
boolean verificationMarks,
boolean exclusionRules)
Clear static mocks.
public void internalMockkConstructor(kotlin.reflect.KClass[] classes,
boolean recordPrivateCalls,
boolean localToThread)
Constructor mockk
public void internalUnmockkConstructor(kotlin.reflect.KClass classes)
Cancel constructor mocks.
public void internalClearConstructorMockk(kotlin.reflect.KClass[] classes,
boolean answers,
boolean recordedCalls,
boolean childMocks,
boolean verificationMarks,
boolean exclusionRules)
Clear constructor mocks.
public void internalUnmockkAll()
Unmockk everything
public void internalClearAllMocks(boolean answers,
boolean recordedCalls,
boolean childMocks,
boolean regularMocks,
boolean objectMocks,
boolean staticMocks,
boolean constructorMocks,
boolean verificationMarks,
boolean exclusionRules)
public boolean internalIsMockKMock(java.lang.Object mock,
boolean regular,
boolean spy,
boolean objectMock,
boolean staticMock,
boolean constructorMock)