FileWriter fw = new FileWriter(f);
fw.write("this is a test");
fw.flush();
fw.close();
OpenEngSBFileModel model = new OpenEngSBFileModel();
model.setFile(f);
model.setId("testId");
EKBCommit commit = getTestEKBCommit().addInsert(model);
persist.commit(commit);
OpenEngSBFileModel result = query.getModel(OpenEngSBFileModel.class, getModelOid("testId"));
File newFile = result.getFile();
BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(newFile)));
String line = reader.readLine();
reader.close();
newFile.delete();
assertThat(result.getFile().getName(), is("testfile.txt"));
assertThat(line, is("this is a test"));
}