Supply this data provider to your MockConnection in order to globally
provide data for SQL statements.
Disclaimer
The general idea of mocking a JDBC connection with this jOOQ API is to provide quick workarounds, injection points, etc. using a very simple JDBC abstraction. It is NOT RECOMMENDED to emulate an entire database (including complex state transitions, transactions, locking, etc.) using this mock API. Once you have this requirement, please consider using an actual database instead for integration testing (e.g. using https://www.testcontainers.org), rather than implementing your test database inside of a MockDataProvider.
See execute(MockExecuteContext) for more details.
MockConnection
| Modifier and Type | Method and Description |
|---|---|
| public MockResult[] | Returns: The execution results. If anull or an empty
MockResult[] is returned, this has the same effect
as returning
new MockResult[] { new MockResult(-1, null) }The execution context. ctx)Execution callback for a JDBC query execution. |
| execute | back to summary |
|---|---|
| public MockResult[] execute(MockExecuteContext ctx) throws SQLException Execution callback for a JDBC query execution.
This callback will be called by
The various execution modes are unified into this simple method. Implementations should adhere to this contract:
| |