org.mockito.listeners.MethodInvocationReport Maven / Gradle / Ivy
/*
* Copyright (c) 2007 Mockito contributors
* This program is made available under the terms of the MIT License.
*/
package org.mockito.listeners;
import org.mockito.exceptions.PrintableInvocation;
import org.mockito.invocation.DescribedInvocation;
/**
* Represent a method call on a mock.
*
*
* Contains the information on the mock, the location of the stub
* the return value if it returned something (maybe null), or an
* exception if one was thrown when the method was invoked.
*
*/
public interface MethodInvocationReport {
/**
* The return type is deprecated, please assign the return value from this method
* to the {@link DescribedInvocation} type. Sorry for inconvenience but we had to move
* {@link PrintableInvocation} to better place to keep the API consistency.
*
* @return Information on the method call, never {@code null}
*/
DescribedInvocation getInvocation();
/**
* @return The resulting value of the method invocation, may be null
*/
Object getReturnedValue();
/**
* @return The throwable raised by the method invocation, maybe null
*/
Throwable getThrowable();
/**
* @return true
if an exception was raised, false
otherwise
*/
boolean threwException();
/**
* @return Location of the stub invocation
*/
String getLocationOfStubbing();
}