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