Class MockMethodExecutionInfo
java.lang.Object
io.r2dbc.proxy.test.MockMethodExecutionInfo
- All Implemented Interfaces:
MethodExecutionInfo
Mock implementation of
MethodExecutionInfo
for testing.- Author:
- Tadaya Tsuyukubo
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Provides a builder forMockMethodExecutionInfo
.static MockMethodExecutionInfo
empty()
Provide an emptyMockMethodExecutionInfo
.Get theConnectionInfo
.Get the duration of the method invocation.Get the invokedMethod
.Object[]
Get the arguments of the invocation.Get the proxy event type.Get the result of invocation.Get the invoked object.long
Get the thread ID.Get the thread name.Get the thrown exception.RetrieveValueStore
which is associated to the scope of before/after method execution.
-
Method Details
-
builder
Provides a builder forMockMethodExecutionInfo
.- Returns:
- builder
-
empty
Provide an emptyMockMethodExecutionInfo
.- Returns:
- a
MockMethodExecutionInfo
.
-
getTarget
Description copied from interface:MethodExecutionInfo
Get the invoked object.- Specified by:
getTarget
in interfaceMethodExecutionInfo
- Returns:
- the proxy instance that the method was invoked on
-
getMethod
Description copied from interface:MethodExecutionInfo
Get the invokedMethod
.- Specified by:
getMethod
in interfaceMethodExecutionInfo
- Returns:
- invoked method
-
getMethodArgs
Description copied from interface:MethodExecutionInfo
Get the arguments of the invocation. This can benull
when method is invoked with no argument.- Specified by:
getMethodArgs
in interfaceMethodExecutionInfo
- Returns:
- argument lists or
null
if the invoked method did not take any arguments
-
getResult
Description copied from interface:MethodExecutionInfo
Get the result of invocation. ForProxyExecutionListener.beforeMethod(MethodExecutionInfo)
callback, this returnsnull
.- Specified by:
getResult
in interfaceMethodExecutionInfo
- Returns:
- result
-
getThrown
Description copied from interface:MethodExecutionInfo
Get the thrown exception. ForProxyExecutionListener.beforeMethod(MethodExecutionInfo)
callback or when the invocation did't throw any error, this returnsnull
.- Specified by:
getThrown
in interfaceMethodExecutionInfo
- Returns:
- thrown exception
-
getConnectionInfo
Description copied from interface:MethodExecutionInfo
Get theConnectionInfo
. When invoked operation is not associated to theConnection
, this returnsnull
.- Specified by:
getConnectionInfo
in interfaceMethodExecutionInfo
- Returns:
- connection info
-
getExecuteDuration
Description copied from interface:MethodExecutionInfo
Get the duration of the method invocation. ForProxyExecutionListener.beforeMethod(MethodExecutionInfo)
callback, this returnsDuration.ZERO
.- Specified by:
getExecuteDuration
in interfaceMethodExecutionInfo
- Returns:
- execution duration
-
getThreadName
Description copied from interface:MethodExecutionInfo
Get the thread name.- Specified by:
getThreadName
in interfaceMethodExecutionInfo
- Returns:
- thread name
-
getThreadId
public long getThreadId()Description copied from interface:MethodExecutionInfo
Get the thread ID.- Specified by:
getThreadId
in interfaceMethodExecutionInfo
- Returns:
- thread ID
-
getProxyEventType
Description copied from interface:MethodExecutionInfo
Get the proxy event type.- Specified by:
getProxyEventType
in interfaceMethodExecutionInfo
- Returns:
- proxy event type; either
ProxyEventType.BEFORE_METHOD
orProxyEventType.AFTER_METHOD
-
getValueStore
Description copied from interface:MethodExecutionInfo
RetrieveValueStore
which is associated to the scope of before/after method execution. Mainly used for passing values betweenProxyExecutionListener.beforeMethod(MethodExecutionInfo)
andProxyExecutionListener.afterMethod(MethodExecutionInfo)
.- Specified by:
getValueStore
in interfaceMethodExecutionInfo
- Returns:
- value store
-