Package-level declarations
Types
Wraps a MockedSingleton and an optional MockedStatic to provide combined mocking of both instance and static methods on Kotlin object declarations.
Properties
Functions
Matches any Kotlin value class with the same boxed type by taking its boxed type.
Creates a KArgumentCaptor for given type.
Creates a KArgumentCaptor for given type, taking in a lambda to allow fast verification.
Creates 2 KArgumentCaptors for given types.
Creates 3 KArgumentCaptors for given types.
Creates 4 KArgumentCaptors for given types.
Creates 5 KArgumentCaptors for given types.
Any array argument that is equal to the given array, i.e. it has to have the same type, length, and each element has to be equal.
boolean array argument that is equal to the given array, i.e. it has to have the same length, and each element has to be equal.
byte array argument that is equal to the given array, i.e. it has to have the same length, and each element has to be equal.
char array argument that is equal to the given array, i.e. it has to have the same length, and each element has to be equal.
double array argument that is equal to the given array, i.e. it has to have the same length, and each element has to be equal.
float array argument that is equal to the given array, i.e. it has to have the same length, and each element has to be equal.
int array argument that is equal to the given array, i.e. it has to have the same length, and each element has to be equal.
long array argument that is equal to the given array, i.e. it has to have the same length, and each element has to be equal.
short array argument that is equal to the given array, i.e. it has to have the same length, and each element has to be equal.
Allows at-least-once verification.
Calls the real method of the spy/mock when the method is called. E.g:
Use this method in order to only clear invocations, when stubbing is non-trivial.
Adds a description to be printed if verification fails.
Sets a generic answer, specified with a lambda, to be applied in reverse stubbing.
Sets an answer to be applied when the stubbed method/function is being called, specified by a lambda. E.g:
Sets a generic answer to be applied when the stubbed method/function is being called. E.g:
Sets to call the real implementation of a method in a mock, to be applied in reverse stubbing.
Calls the real method of the spy/mock when the method is called. E.g:
Sets a value to be returned when the stubbed method/function is being called. E.g:
Sets values to be returned when the stubbed method/function is being called consecutively. E.g:
Sets a generic answer, specified with a suspendable lambda, to be applied in reverse stubbing.
Sets an answer to be applied when the stubbed suspendable function is being called, specified by a suspendable lambda. E.g:
Sets a throwable to be thrown, to be applied in reverse stubbing.
Sets a throwable type to be thrown, to be applied in reverse stubbing.
Sets throwables to be thrown on consecutive calls, to be applied in reverse stubbing.
Sets throwable types to be thrown on consecutive calls, to be applied in reverse stubbing.
Sets a throwable to be thrown when the stubbed method/function is being called. E.g:
Sets a throwable type to be thrown when the stubbed method/function is being called. E.g:
Sets throwables to be thrown when the stubbed method/function is being called consecutively. E.g:
Sets throwable types to be thrown when the stubbed method is called consecutively. E.g:
Matches an argument that is equal to the given Kotlin value class value.
Alias for BDDMockito.given with a suspending lambda
Ignores stubbed methods of given mocks for the sake of verification.
Creates a mock for T.
Creates a mock for T, allowing for immediate stubbing.
Creates a thread-local mock for constructions of T.
Creates a thread-local mock for the static methods of the class that contains this top-level extension function.
Creates a thread-local mock for an object or companion object singleton.
Creates a thread-local mock for an object or companion object singleton, allowing for immediate stubbing.
Creates a thread-local mock for static methods on T.
Creates a KArgumentCaptor for given nullable type.
Creates a KArgumentCaptor for given nullable type, taking in a lambda to allow fast verification.
Creates a spy of the real object. The spy calls real methods unless they are stubbed.
Creates a spy of the real object, allowing for immediate stubbing. The spy calls real methods unless they are stubbed.
Creates a KArgumentCaptor for given (suspend function).
Verifies certain behavior happened once.
Verify multiple calls on mock Supports an easier to read style of
Verifies certain behavior happened at least once / exact number of times / never.
Syntax sugar to enable SAM conversion syntax for MockedStatic.verify with a VerificationMode.
Verifies certain suspending behavior happened once.
Verifies certain behavior happened at least once / exact number of times / never.
Checks if any of given mocks has any unverified interaction.
Verifies that no interactions happened on given mocks beyond the previously verified interactions.
Sets the mock to apply the reverse stubbing on.
Sets the mock and the method call to be stubbed. With this version of whenever you can reverse stub either synchronous or suspendable function calls.
Enables stubbing methods/function calls. In case of Kotlin function calls, these can be either synchronous or suspendable function calls.
Sets the mock and the method call to be stubbed. With this version of whenever you can reverse stub either synchronous or suspendable function calls.
Alias for BDDMyOngoingStubbing.willAnswer, accepting a lambda.
Alias for BDDMyOngoingStubbing.willReturn.
Alias for BDDMyOngoingStubbing.willAnswer, accepting a suspend lambda.
Alias for BDDMyOngoingStubbing.willThrow.
Sets a Throwable type to be thrown when the method is called.
Sets Throwable classes to be thrown when the method is called.
Allows mock creation with additional mock settings. See MockSettings.