RemoveDocumentSetTransformer { public EbXMLRemoveObjectsRequest toEbXML(RemoveDocumentSet request) { if (request == null) { return null; } EbXMLRemoveObjectsRequest ebXML = factory.createRemoveObjectsRequest(); ebXML.setReferences(request.getReferences()); ebXML.setDeletionScope(request.getDeletionScope()); if (request.getQuery() != null){ Query query = request.getQuery(); query.accept(new ToEbXMLVisitor(ebXML)); } return ebXML; } RemoveDocumentSetTransformer(); EbXMLRemoveObjectsRequest toEbXML(RemoveDocumentSet request); RemoveDocumentSet fromEbXML(EbXMLRemoveObjectsRequest ebXML);  }
@Test public void testToEbXML() { QueryRegistry queryRegistry = SampleData.createFindDocumentsQuery(); request.setQuery(queryRegistry.getQuery()); EbXMLRemoveObjectsRequest ebXML = transformer.toEbXML(request); assertNotNull(ebXML); assertEquals(2, ebXML.getReferences().size()); assertEquals("1.2.3", ebXML.getReferences().get(0).getHome()); assertEquals("5.6.7", ebXML.getReferences().get(1).getHome()); assertEquals(RemoveDocumentSet.DEFAULT_DELETION_SCOPE, ebXML.getDeletionScope()); assertNotNull("12.21.41", ebXML.getHome()); assertEquals("urn:uuid:14d4debf-8f97-4251-9a74-a90016b0af0d", ebXML.getId()); }
@Test public void testToEbXMLNull() { assertNull(transformer.toEbXML(null)); }
@Test public void testToEbXMLEmpty() { EbXMLRemoveObjectsRequest result = transformer.toEbXML(new RemoveDocumentSet()); assertNotNull(result); assertNotNull(result.getReferences()); assertEquals(0, result.getReferences().size()); assertEquals(RemoveDocumentSet.DEFAULT_DELETION_SCOPE, result.getDeletionScope()); }
@Test public void testFromEbXMLNull() { assertNull(transformer.toEbXML(null)); }