@Test
public void testGetBasicMetadata() throws CatalogException, IOException {
File file = catalogManager.getFileManager().create(study.getFqn(), new File().setPath(folder.getPath() + "test.txt"), false,
StringUtils.randomString(1000), null, sessionIdUser).first();
assertEquals(1000, file.getSize());
String creationDate = file.getCreationDate();
String modificationDate = file.getModificationDate();
URI fileUri = catalogManager.getFileManager().getUri(file);
try {
Thread.sleep(1000);
} catch (InterruptedException ignored) {}
OutputStream outputStream = new FileOutputStream(Paths.get(fileUri).toFile(), true);
byte[] bytes2 = StringUtils.randomString(100).getBytes();
outputStream.write(bytes2);
outputStream.close();
file = FileMetadataReader.get(catalogManager).
setMetadataInformation(file, null, null, sessionIdUser, false);
assertEquals(1000 + bytes2.length, file.getSize());
assertTrue(TimeUtils.toDate(modificationDate).getTime() < TimeUtils.toDate(file.getModificationDate()).getTime());
assertEquals(creationDate, file.getCreationDate());
}