[jOOQ/jOOQ#9307] Add Mock.of(SQLException)
This commit is contained in:
parent
94d4d86ffa
commit
5ac90766c3
@ -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.
|
||||
*/
|
||||
|
||||
Loading…
Reference in New Issue
Block a user