final Element sampleMetadataXml = getSampleMetadataXml();
final UserSession userSession = serviceContext.getUserSession();
final int userIdAsInt = userSession.getUserIdAsInt();
final DataManager dm = DataManagerWorksWithoutTransactionIntegrationTest.this.dataManager;
String schema = dm.autodetectSchema(sampleMetadataXml);
final String mdId = dm.insertMetadata(serviceContext, schema, sampleMetadataXml,
"uuid" + _inc.incrementAndGet(), userIdAsInt, "2", "source",
MetadataType.METADATA.codeString, null, metadataCategory, new ISODate().getDateAndTime(),
new ISODate().getDateAndTime(), false, false);
Element newMd = new Element(sampleMetadataXml.getName(), sampleMetadataXml.getNamespace()).addContent(new Element("fileIdentifier",
GMD).addContent(new Element("CharacterString", GCO)));