entry.setSummary("testdesc");
entry.setPublished(new Date());
entry.getAuthors().add(new Person("testperson"));
entry.setId(baseUri);
AtomAssetMetadata atomAssetMetadata = entry.getAnyOtherJAXBObject(AtomAssetMetadata.class);
if (atomAssetMetadata == null) {
atomAssetMetadata = new AtomAssetMetadata();
}
atomAssetMetadata.setArchived(false);
atomAssetMetadata.setUuid("testuuid");
atomAssetMetadata.setCategories(new String[]{"a", "b", "c"});
entry.setAnyOtherJAXBObject(atomAssetMetadata);
Content content = new Content();
content.setSrc(UriBuilder.fromUri(baseUri).path("binary").build());
content.setType(MediaType.APPLICATION_OCTET_STREAM_TYPE);
entry.setContent(content);
Class[] classes = new Class[]{AtomAssetMetadata.class, Entry.class};
JAXBContext jaxbContext = JAXBContext.newInstance(classes);
Marshaller marshaller = jaxbContext.createMarshaller();
Writer xmlWriter = new StringWriter();
marshaller.marshal(entry, xmlWriter);
String xmlOut = xmlWriter.toString();
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
StringReader xmlReader = new StringReader(xmlOut);
Entry newEntry = (Entry) unmarshaller.unmarshal(xmlReader);
atomAssetMetadata = newEntry.getAnyOtherJAXBObject(AtomAssetMetadata.class);
assertNotNull(atomAssetMetadata);
assertNotNull(atomAssetMetadata.getCategories());
}