java.lang.Object
org.jooq.tools.jdbc.Mock
Various utilities related to
MockDataProvider
.
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.
- Author:
- Lukas Eder
-
Method Summary
Modifier and TypeMethodDescriptionstatic final MockDataProvider
of
(int rows) Create a newMockDataProvider
that always returns a single record for all queries.static final MockDataProvider
of
(SQLException exception) Create a newMockDataProvider
that always throws the same exception for all queries.static final MockDataProvider
Create a newMockDataProvider
that always returns a single record for all queries.static final MockDataProvider
Create a newMockDataProvider
that always returns the same result for all queries.static final MockDataProvider
of
(MockResult... result) Create a newMockDataProvider
that always returns the same mock results for all queries.
-
Method Details
-
of
Create a newMockDataProvider
that always returns a single record for all queries. -
of
Create a newMockDataProvider
that always returns a single record for all queries. -
of
Create a newMockDataProvider
that always returns the same result for all queries. -
of
Create a newMockDataProvider
that always returns the same mock results for all queries. -
of
Create a newMockDataProvider
that always throws the same exception for all queries.
-