}
@Test
public void testBinarySaveAndLoad() throws IOException {
FileEntry fileEntry = new FileEntry();
fileEntry.setContent("HELLO WORLD2");
fileEntry.setEncoding("UTF-8");
fileEntry.setPath("helloworld.txt");
fileEntry.setFileType(FileType.TXT);
fileEntry.setDescription("WOW");
repo.save(getTestUser(), fileEntry, fileEntry.getEncoding());
fileEntry.setPath("hello.zip");
fileEntry.setEncoding(null);
fileEntry.setFileType(FileType.UNKNOWN);
byte[] byteArray = IOUtils.toByteArray(new ClassPathResource("TEST_USER.zip").getInputStream());
fileEntry.setContentBytes(byteArray);
repo.save(getTestUser(), fileEntry, null);
List<FileEntry> findAll = repo.findAll(getTestUser(), "hello.zip", null);
FileEntry foundEntry = findAll.get(0);
assertThat(foundEntry.getFileSize(), is((long) byteArray.length));
// commit again
repo.save(getTestUser(), fileEntry, null);
findAll = repo.findAll(getTestUser(), "hello.zip", null);
assertThat(foundEntry.getFileSize(), is((long) byteArray.length));
}