### Question:
RowMapper { public static String getTransactionId(TransactionalBufferMetrics metrics, ResultSet rs) { try { return DatatypeConverter.printHexBinary(rs.getBytes(TX_ID)); } catch (SQLException e) { logError(metrics, e, "TX_ID"); return ""; } }  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; }### Answer:
@Test public void testGetTransactionId() throws SQLException { Mockito.when(rs.getBytes(5)).thenReturn("tr_id".getBytes()); String transactionId = RowMapper.getTransactionId(metrics, rs); assertThat(transactionId.equals("74725F6964")).isTrue(); verify(rs).getBytes(5); Mockito.when(rs.getBytes(5)).thenThrow(SQLException.class); transactionId = RowMapper.getTransactionId(metrics, rs); assertThat(transactionId.equals("")).isTrue(); verify(rs, times(2)).getBytes(5); }