public final class MockConnectionInfo extends Object implements ConnectionInfo
ConnectionInfo for testing.| Modifier and Type | Class and Description |
|---|---|
static class |
MockConnectionInfo.Builder |
| Modifier and Type | Method and Description |
|---|---|
static MockConnectionInfo.Builder |
builder()
Provides a builder for
MockConnectionInfo. |
static MockConnectionInfo |
empty()
Provide an empty
MockConnectionInfo. |
int |
getCommitCount()
Returns how many times
Connection.commitTransaction() method is called. |
String |
getConnectionId()
Get ID for the connection.
|
io.r2dbc.spi.Connection |
getOriginalConnection()
Retrieve original
Connection. |
int |
getRollbackCount()
Returns how many times
Connection.rollbackTransaction() method is called. |
int |
getTransactionCount()
Returns how many times
Connection.beginTransaction() method is called. |
ValueStore |
getValueStore()
Retrieve
ValueStore which is associated to the scope of logical connection. |
void |
incrementCommitCount()
Increment commit count.
|
void |
incrementRollbackCount()
Increment rollback count.
|
void |
incrementTransactionCount()
Increment transaction count.
|
boolean |
isClosed()
Returns whether connection is closed or not.
|
void |
setClosed(boolean closed)
Set
boolean to indicate whether the connection is closed or not. |
public static MockConnectionInfo.Builder builder()
MockConnectionInfo.public static MockConnectionInfo empty()
MockConnectionInfo.MockConnectionInfo.public io.r2dbc.spi.Connection getOriginalConnection()
ConnectionInfoConnection.getOriginalConnection in interface ConnectionInfonull is returned when ConnectionInfo is evaluated
before it is associated with an actual connection, for example, during
ProxyExecutionListener.beforeMethod(MethodExecutionInfo) for
ConnectionFactory.create().public String getConnectionId()
ConnectionInfogetConnectionId in interface ConnectionInfonull is returned when ConnectionInfo is evaluated
before it is associated with an actual connection, for example, during
ProxyExecutionListener.beforeMethod(MethodExecutionInfo) for
ConnectionFactory.create().ConnectionIdManagerpublic void incrementTransactionCount()
ConnectionInfoincrementTransactionCount in interface ConnectionInfopublic void incrementCommitCount()
ConnectionInfoincrementCommitCount in interface ConnectionInfopublic void incrementRollbackCount()
ConnectionInfoincrementRollbackCount in interface ConnectionInfopublic int getTransactionCount()
ConnectionInfoConnection.beginTransaction() method is called.getTransactionCount in interface ConnectionInfopublic int getCommitCount()
ConnectionInfoConnection.commitTransaction() method is called.getCommitCount in interface ConnectionInfopublic int getRollbackCount()
ConnectionInfoConnection.rollbackTransaction() method is called.getRollbackCount in interface ConnectionInfopublic boolean isClosed()
ConnectionInfoisClosed in interface ConnectionInfotrue if connection is closedpublic void setClosed(boolean closed)
ConnectionInfoboolean to indicate whether the connection is closed or not.setClosed in interface ConnectionInfoclosed - set true if Connection is closedpublic ValueStore getValueStore()
ConnectionInfoValueStore which is associated to the scope of logical connection.
Values can be stored or retrieved from this store while connection is available.
getValueStore in interface ConnectionInfoCopyright © 2025. All rights reserved.