@Test public void testGetScn() throws SQLException { Mockito.when(rs.getBigDecimal(1)).thenReturn(new BigDecimal(1)); BigDecimal scn = RowMapper.getScn(metrics, rs); assertThat(scn.equals(new BigDecimal(1))).isTrue(); verify(rs).getBigDecimal(1); Mockito.when(rs.getBigDecimal(1)).thenThrow(SQLException.class); scn = RowMapper.getScn(metrics, rs); assertThat(scn.equals(new BigDecimal(-1))).isTrue(); verify(rs, times(2)).getBigDecimal(1); }
public static BigDecimal getScn(TransactionalBufferMetrics metrics, ResultSet rs) { try { return rs.getBigDecimal(SCN); } catch (SQLException e) { logError(metrics, e, "SCN"); return new BigDecimal(-1); } }
RowMapper { public static BigDecimal getScn(TransactionalBufferMetrics metrics, ResultSet rs) { try { return rs.getBigDecimal(SCN); } catch (SQLException e) { logError(metrics, e, "SCN"); return new BigDecimal(-1); } } }
RowMapper { public static BigDecimal getScn(TransactionalBufferMetrics metrics, ResultSet rs) { try { return rs.getBigDecimal(SCN); } catch (SQLException e) { logError(metrics, e, "SCN"); return new BigDecimal(-1); } }  }
RowMapper { public static BigDecimal getScn(TransactionalBufferMetrics metrics, ResultSet rs) { try { return rs.getBigDecimal(SCN); } catch (SQLException e) { logError(metrics, e, "SCN"); return new BigDecimal(-1); } }  static String getOperation(TransactionalBufferMetrics metrics, ResultSet rs); static String getUsername(TransactionalBufferMetrics metrics, ResultSet rs); static int getOperationCode(TransactionalBufferMetrics metrics, ResultSet rs); static String getTableName(TransactionalBufferMetrics metrics, ResultSet rs); static String getSegOwner(TransactionalBufferMetrics metrics, ResultSet rs); static Timestamp getChangeTime(TransactionalBufferMetrics metrics, ResultSet rs); static BigDecimal getScn(TransactionalBufferMetrics metrics, ResultSet rs); static String getTransactionId(TransactionalBufferMetrics metrics, ResultSet rs); static String getSqlRedo(TransactionalBufferMetrics metrics, ResultSet rs); static TableId getTableId(String catalogName, ResultSet rs); }
RowMapper { public static BigDecimal getScn(TransactionalBufferMetrics metrics, ResultSet rs) { try { return rs.getBigDecimal(SCN); } catch (SQLException e) { logError(metrics, e, "SCN"); return new BigDecimal(-1); } }  static String getOperation(TransactionalBufferMetrics metrics, ResultSet rs); static String getUsername(TransactionalBufferMetrics metrics, ResultSet rs); static int getOperationCode(TransactionalBufferMetrics metrics, ResultSet rs); static String getTableName(TransactionalBufferMetrics metrics, ResultSet rs); static String getSegOwner(TransactionalBufferMetrics metrics, ResultSet rs); static Timestamp getChangeTime(TransactionalBufferMetrics metrics, ResultSet rs); static BigDecimal getScn(TransactionalBufferMetrics metrics, ResultSet rs); static String getTransactionId(TransactionalBufferMetrics metrics, ResultSet rs); static String getSqlRedo(TransactionalBufferMetrics metrics, ResultSet rs); static TableId getTableId(String catalogName, ResultSet rs); static final int INSERT; static final int DELETE; static final int UPDATE; static final int DDL; static final int COMMIT; static final int MISSING_SCN; static final int ROLLBACK; }