Payloads allow you to parameterize your mocks and dynamically control what happens within the mock function. In the example above, we have declared two similar mock functions. With the payload mechanism, it is possible to control the behavior of your mock functions.