mockk
Builds a new mock for specified class.
A mock is a fake version of a class that replaces all the methods with fake implementations.
By default, every method that you wish to mock should be stubbed using every. Otherwise, it will throw when called, so you know if you forgot to mock a method. If relaxed or relaxUnitFun is set to true, methods will automatically be stubbed.
Parameters
mock name
allows creation with no specific behaviour. Unstubbed methods will not throw.
additional interfaces for this mockk to implement, in addition to the specified class.
allows creation with no specific behaviour for Unit function. Unstubbed methods that return Unit will not throw, while other methods will still throw unless they are stubbed.
block to execute after mock is created with mock as a receiver. Similar to using apply on the mock object.