assertEquals(content1, content2);
}
@Test
public void createDocumentAndUpdateContent() throws IOException {
ObjectId parentId = this.session.createObjectId(this.fixture.getTestRootId());
String folderName = UUID.randomUUID().toString();
String typeId = FixtureData.DOCUMENT_TYPE_ID.value();
Map<String, Object> properties = new HashMap<String, Object>();
properties.put(PropertyIds.NAME, folderName);
properties.put(PropertyIds.OBJECT_TYPE_ID, typeId);
String filename1 = UUID.randomUUID().toString();
String mimetype = "text/html; charset=UTF-8";
String content1 = "Im Walde rauscht ein Wasserfall. Wenn's nicht mehr rauscht ist's Wasser all.";
byte[] buf1 = content1.getBytes("UTF-8");
ByteArrayInputStream in1 = new ByteArrayInputStream(buf1);
ContentStream contentStream1 = this.session.getObjectFactory().createContentStream(filename1, buf1.length,
mimetype, in1);
assertNotNull(contentStream1);
ObjectId id = this.session.createDocument(properties, parentId, contentStream1, VersioningState.NONE, null,
null, null);
assertNotNull(id);
// set and verify content
String filename2 = UUID.randomUUID().toString();