### Question:
UnknownTypeHandler extends BaseTypeHandler<Object> { @Override public Object getNullableResult(ResultSet rs, String columnName) throws SQLException { TypeHandler<?> handler = resolveTypeHandler(rs, columnName); return handler.getResult(rs, columnName); } UnknownTypeHandler(Configuration configuration); @Deprecated  UnknownTypeHandler(TypeHandlerRegistry typeHandlerRegistry); @Override void setNonNullParameter(PreparedStatement ps, int i, Object parameter, JdbcType jdbcType); @Override Object getNullableResult(ResultSet rs, String columnName); @Override Object getNullableResult(ResultSet rs, int columnIndex); @Override Object getNullableResult(CallableStatement cs, int columnIndex);  }### Answer:
@Test void getResultWithResultSetAndColumnNameThrowsException() throws SQLException { doThrow(new SQLException("invalid column")).when((UnknownTypeHandler) TYPE_HANDLER).getNullableResult(rs, "foo"); try { TYPE_HANDLER.getResult(rs, "foo"); Assertions.fail("Should have thrown a ResultMapException"); } catch (Exception e) { Assertions.assertTrue(e instanceof ResultMapException, "Expected ResultMapException"); Assertions.assertTrue(e.getMessage().contains("column 'foo'"), "column name is not in exception"); } }
@Test void getResultWithResultSetAndColumnIndexThrowsException() throws SQLException { doThrow(new SQLException("invalid column")).when((UnknownTypeHandler) TYPE_HANDLER).getNullableResult(rs, 1); try { TYPE_HANDLER.getResult(rs, 1); Assertions.fail("Should have thrown a ResultMapException"); } catch (Exception e) { Assertions.assertTrue(e instanceof ResultMapException, "Expected ResultMapException"); Assertions.assertTrue(e.getMessage().contains("column #1"), "column index is not in exception"); } }
@Test void getResultWithCallableStatementAndColumnIndexThrowsException() throws SQLException { doThrow(new SQLException("invalid column")).when((UnknownTypeHandler) TYPE_HANDLER).getNullableResult(cs, 1); try { TYPE_HANDLER.getResult(cs, 1); Assertions.fail("Should have thrown a ResultMapException"); } catch (Exception e) { Assertions.assertTrue(e instanceof ResultMapException, "Expected ResultMapException"); Assertions.assertTrue(e.getMessage().contains("column #1"), "column index is not in exception"); } }