Class MockFunction<Argument,Value>

java.lang.Object
org.dmfs.jems2.mocks.MockFunction<Argument,Value>
All Implemented Interfaces:
org.dmfs.jems2.FragileFunction<Argument,Value,RuntimeException>, org.dmfs.jems2.Function<Argument,Value>, org.dmfs.jems2.ThrowingFunction<Argument,Value>

public final class MockFunction<Argument,Value> extends Object implements org.dmfs.jems2.Function<Argument,Value>
Mock Function that can be used in tests as a convenience instead of 'manually' set up expectations for (multiple) calls.

It can be set up with Argument-Value Pairs so that when it is called it returns the Value from the Pair of the matching Argument.

For invocations with arguments that don't match any of the provided ones, it throws AssertionError.