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 MockMethodExecutionInfoempty()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.longGet the thread ID.Get the thread name.Get the thrown exception.RetrieveValueStorewhich 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:MethodExecutionInfoGet the invoked object.- Specified by:
getTargetin interfaceMethodExecutionInfo- Returns:
- the proxy instance that the method was invoked on
-
getMethod
Description copied from interface:MethodExecutionInfoGet the invokedMethod.- Specified by:
getMethodin interfaceMethodExecutionInfo- Returns:
- invoked method
-
getMethodArgs
Description copied from interface:MethodExecutionInfoGet the arguments of the invocation. This can benullwhen method is invoked with no argument.- Specified by:
getMethodArgsin interfaceMethodExecutionInfo- Returns:
- argument lists or
nullif the invoked method did not take any arguments
-
getResult
Description copied from interface:MethodExecutionInfoGet the result of invocation. ForProxyExecutionListener.beforeMethod(MethodExecutionInfo)callback, this returnsnull.- Specified by:
getResultin interfaceMethodExecutionInfo- Returns:
- result
-
getThrown
Description copied from interface:MethodExecutionInfoGet the thrown exception. ForProxyExecutionListener.beforeMethod(MethodExecutionInfo)callback or when the invocation did't throw any error, this returnsnull.- Specified by:
getThrownin interfaceMethodExecutionInfo- Returns:
- thrown exception
-
getConnectionInfo
Description copied from interface:MethodExecutionInfoGet theConnectionInfo. When invoked operation is not associated to theConnection, this returnsnull.- Specified by:
getConnectionInfoin interfaceMethodExecutionInfo- Returns:
- connection info
-
getExecuteDuration
Description copied from interface:MethodExecutionInfoGet the duration of the method invocation. ForProxyExecutionListener.beforeMethod(MethodExecutionInfo)callback, this returnsDuration.ZERO.- Specified by:
getExecuteDurationin interfaceMethodExecutionInfo- Returns:
- execution duration
-
getThreadName
Description copied from interface:MethodExecutionInfoGet the thread name.- Specified by:
getThreadNamein interfaceMethodExecutionInfo- Returns:
- thread name
-
getThreadId
public long getThreadId()Description copied from interface:MethodExecutionInfoGet the thread ID.- Specified by:
getThreadIdin interfaceMethodExecutionInfo- Returns:
- thread ID
-
getProxyEventType
Description copied from interface:MethodExecutionInfoGet the proxy event type.- Specified by:
getProxyEventTypein interfaceMethodExecutionInfo- Returns:
- proxy event type; either
ProxyEventType.BEFORE_METHODorProxyEventType.AFTER_METHOD
-
getValueStore
Description copied from interface:MethodExecutionInfoRetrieveValueStorewhich is associated to the scope of before/after method execution. Mainly used for passing values betweenProxyExecutionListener.beforeMethod(MethodExecutionInfo)andProxyExecutionListener.afterMethod(MethodExecutionInfo).- Specified by:
getValueStorein interfaceMethodExecutionInfo- Returns:
- value store
-