public final class MockMethodExecutionInfo extends Object implements MethodExecutionInfo
MethodExecutionInfo
for testing.Modifier and Type | Class and Description |
---|---|
static class |
MockMethodExecutionInfo.Builder |
Modifier and Type | Method and Description |
---|---|
static MockMethodExecutionInfo.Builder |
builder()
Provides a builder for
MockMethodExecutionInfo . |
static MockMethodExecutionInfo |
empty()
Provide an empty
MockMethodExecutionInfo . |
ConnectionInfo |
getConnectionInfo()
Get the
ConnectionInfo . |
Duration |
getExecuteDuration()
Get the duration of the method invocation.
|
Method |
getMethod()
Get the invoked
Method . |
Object[] |
getMethodArgs()
Get the arguments of the invocation.
|
ProxyEventType |
getProxyEventType()
Get the proxy event type.
|
Object |
getResult()
Get the result of invocation.
|
Object |
getTarget()
Get the invoked object.
|
long |
getThreadId()
Get the thread ID.
|
String |
getThreadName()
Get the thread name.
|
Throwable |
getThrown()
Get the thrown exception.
|
ValueStore |
getValueStore()
Retrieve
ValueStore which is associated to the scope of before/after method execution. |
public static MockMethodExecutionInfo.Builder builder()
MockMethodExecutionInfo
.public static MockMethodExecutionInfo empty()
MockMethodExecutionInfo
.MockMethodExecutionInfo
.public Object getTarget()
MethodExecutionInfo
getTarget
in interface MethodExecutionInfo
public Method getMethod()
MethodExecutionInfo
Method
.getMethod
in interface MethodExecutionInfo
public Object[] getMethodArgs()
MethodExecutionInfo
null
when method is invoked with no argument.getMethodArgs
in interface MethodExecutionInfo
null
if the invoked method did not take any argumentspublic Object getResult()
MethodExecutionInfo
ProxyExecutionListener.beforeMethod(MethodExecutionInfo)
callback, this returns null
.getResult
in interface MethodExecutionInfo
public Throwable getThrown()
MethodExecutionInfo
ProxyExecutionListener.beforeMethod(MethodExecutionInfo)
callback or when the invocation
did't throw any error, this returns null
.getThrown
in interface MethodExecutionInfo
public ConnectionInfo getConnectionInfo()
MethodExecutionInfo
ConnectionInfo
.
When invoked operation is not associated to the Connection
, this returns null
.getConnectionInfo
in interface MethodExecutionInfo
public Duration getExecuteDuration()
MethodExecutionInfo
ProxyExecutionListener.beforeMethod(MethodExecutionInfo)
callback, this returns Duration.ZERO
.getExecuteDuration
in interface MethodExecutionInfo
public String getThreadName()
MethodExecutionInfo
getThreadName
in interface MethodExecutionInfo
public long getThreadId()
MethodExecutionInfo
getThreadId
in interface MethodExecutionInfo
public ProxyEventType getProxyEventType()
MethodExecutionInfo
getProxyEventType
in interface MethodExecutionInfo
ProxyEventType.BEFORE_METHOD
or ProxyEventType.AFTER_METHOD
public ValueStore getValueStore()
MethodExecutionInfo
ValueStore
which is associated to the scope of before/after method execution.
Mainly used for passing values between ProxyExecutionListener.beforeMethod(MethodExecutionInfo)
and
ProxyExecutionListener.afterMethod(MethodExecutionInfo)
.getValueStore
in interface MethodExecutionInfo
Copyright © 2025. All rights reserved.