assertEquals(fileVersion, fileHistory.getFileVersion(5L));
}
@Test
public void testFileHistoryClone() {
FileVersion fileVersion1 = new FileVersion();
fileVersion1.setVersion(1L);
fileVersion1.setPath("/somepath");
FileVersion fileVersion2 = new FileVersion();
fileVersion2.setVersion(2L);
fileVersion2.setPath("/somepath");
PartialFileHistory fileHistory = new PartialFileHistory(FileHistoryId.parseFileId("1234"));
fileHistory.addFileVersion(fileVersion1);
fileHistory.addFileVersion(fileVersion2);
PartialFileHistory fileHistoryClone = fileHistory.clone();
assertEquals(fileHistory, fileHistoryClone);
assertEquals(fileHistory.getFileVersions().size(), fileHistoryClone.getFileVersions().size());
assertEquals(fileHistory.getFileVersions(), fileHistoryClone.getFileVersions());
FileVersion fileVersion3 = new FileVersion();
fileVersion3.setVersion(3L);
fileVersion3.setPath("/somepath");
fileHistoryClone.addFileVersion(fileVersion3);
assertEquals(fileHistory.getFileVersions().size()+1, fileHistoryClone.getFileVersions().size());
}