@Test public void testFileHistoryIdRandom() { FileHistoryId secureRandomFileId1 = FileHistoryId.secureRandomFileId(); FileHistoryId secureRandomFileId2 = FileHistoryId.secureRandomFileId(); assertNotNull(secureRandomFileId1); assertEquals(20 * 2, secureRandomFileId1.toString().length()); assertNotSame(secureRandomFileId1, secureRandomFileId2); assertNotNull(secureRandomFileId2); assertEquals(20 * 2, secureRandomFileId2.toString().length()); }
private PartialFileHistory createNewFileHistory(PartialFileHistory lastFileHistory) { if (lastFileHistory == null) { FileHistoryId newFileHistoryId = FileHistoryId.secureRandomFileId(); return new PartialFileHistory(newFileHistoryId); } else { return new PartialFileHistory(lastFileHistory.getFileHistoryId()); } }