[jOOQ/jOOQ#9307] Add Mock.of(SQLException)

This commit is contained in:
Lukas Eder 2019-09-30 11:26:11 +02:00
parent 94d4d86ffa
commit 5ac90766c3

View File

@ -39,6 +39,8 @@ package org.jooq.tools.jdbc;
import static org.jooq.impl.DSL.using;
import java.sql.SQLException;
import org.jooq.Record;
import org.jooq.Result;
@ -86,6 +88,14 @@ public final class Mock {
};
}
/**
* Create a new {@link MockDataProvider} that always throws the same
* exception for all queries.
*/
public static final MockDataProvider of(SQLException exception) {
return of(new MockResult(exception));
}
/**
* Wrap a record in a result.
*/