-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add plain JDBC ApplicationErrorDao implementation
* Add JdbcApplicationErrorDao, a plain JDBC implementation of ApplicationErrorDao * Since the logic to map from a ResultSet is identical for the JDBC and JDBI implementations, move that logic from the Jdbi3ApplicationErrorRowMapper into ApplicationErrorJdbc in a new method 'mapFrom(ResultSet)'. Also, fix how the port is set, using rs.getInt instead of intValueOrNull, since the port field in ApplicationError is an int, not Integer * Add new constructor accepting only a Throwable to ApplicationErrorJdbc.ApplicationErrorJdbcException * Add several new helper methods to ApplicationErrorJdbc for the JDBC implementation, nextOrThrow and shutdownH2Database * Add abstract base test class, AbstractJdbcApplicationErrorDaoTest, and two subclasses for testing against H2 and Postgres * Make sure to shut down the in-memory H2 database in both H2Jdbi3ApplicationErrorDaoTest and H2JdbcApplicationErrorDaoTest. Otherwise, if the H2 JDBI test runs after the JDBC one, the tests fail because they expect the database to be empty. By shutting the in-memory database down, we ensure the tests are completely isolated. Misc: * Remove two redundant warning suppression annotations from ErrorContextUtilitiesTest Closes #248
- Loading branch information
1 parent
41c00b4
commit fe67efb
Showing
9 changed files
with
612 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.