DLUtils { public static long deserializeTransactionId(byte[] data) { String seqNoStr = new String(data, UTF_8); return Long.parseLong(seqNoStr); }  static String getZKServersFromDLUri(URI uri); static int findLogSegmentNotLessThanTxnId(List<LogSegmentMetadata> segments,
                                                     long transactionId); static Long nextLogSegmentSequenceNumber(List<LogSegmentMetadata> segmentListDesc); static long computeStartSequenceId(List<LogSegmentMetadata> logSegmentDescList,
                                              LogSegmentMetadata segment); static long deserializeLogSegmentSequenceNumber(byte[] data); static byte[] serializeLogSegmentSequenceNumber(long logSegmentSeqNo); static long deserializeTransactionId(byte[] data); static byte[] serializeTransactionId(long transactionId); static byte[] ledgerId2Bytes(long ledgerId); static long bytes2LedgerId(byte[] data);  }
@Test(timeout = 60000, expected = NumberFormatException.class) public void testDeserilizeInvalidLogRecordTxnId() throws Exception { byte[] corruptedData = "corrupted-txn-id".getBytes(UTF_8); DLUtils.deserializeTransactionId(corruptedData); }