blob: 07f68f7e19f3f05c622dbe6b6da0578302fbf639 [file] [log] [blame]
/*
* Copyright (c) 2007 Mockito contributors
* This program is made available under the terms of the MIT License.
*/
package org.mockito.invocation;
import org.mockito.Incubating;
import java.io.Serializable;
/**
* Mockito handler of an invocation on a mock. This is a core part of the API, the heart of Mockito.
* See also the {@link org.mockito.plugins.MockMaker}.
* <p>
* This api is work in progress. Do not provide your own implementations.
* Mockito will provide you with the implementation via other {@link org.mockito.plugins.MockMaker} methods.
*/
@Incubating
public interface MockHandler extends Serializable {
/**
* Takes an invocation object and handles it.
* <p>
* The default implementation provided by Mockito handles invocations by recording
* method calls on mocks for further verification, captures the stubbing information when mock is stubbed,
* returns the stubbed values for invocations that have been stubbed, and much more.
*
* @param invocation The invocation to handle
* @return Result
* @throws Throwable Throwable
*/
@Incubating
Object handle(Invocation invocation) throws Throwable;
}