final Element sampleMetadataXml = getSampleMetadataXml();
final UserSession userSession = serviceContext.getUserSession();
final int userIdAsInt = userSession.getUserIdAsInt();
final String mdId = _dataManager.insertMetadata(serviceContext, "iso19139", sampleMetadataXml,
"uuid" + _inc.incrementAndGet(), userIdAsInt, "2", "source",
MetadataType.METADATA.codeString, null, "maps", new ISODate().getDateAndTime(),
new ISODate().getDateAndTime(), false, false);
Element newMd = new Element("MD_Metadata", GMD).addContent(new Element("fileIdentifier",
GMD).addContent(new Element("CharacterString", GCO)));
Metadata updateMd = _dataManager.updateMetadata(serviceContext, mdId, newMd, false, false, false, "eng",
new ISODate().getDateAndTime(), false);
assertNotNull(updateMd);
final boolean hasNext = updateMd.getCategories().iterator().hasNext();
assertTrue(hasNext);
}
});