private void validateRecord(DocumentRecord record) { assertNotNull("DocumentRecord should never be null", record); assertNotNull("Document uri should never be null", record.getUri()); assertTrue("Document uri should start with " + DIRECTORY, record.getUri().startsWith(DIRECTORY)); assertEquals("All records are expected to be XML format", Format.XML, record.getFormat()); /* assertEquals("All records are expected to be mimetype application/xml", "application/xml", record.getMimetype()); */ if ( record.getUri().equals(DIRECTORY + "1205733.xml") ) { City chittagong = record.getContentAs(City.class); validateChittagong(chittagong); } }
.onDocumentReady(doc -> { String contents = doc.getContentAs(String.class); if ( ! "test contents".equals(contents) ) { badDocs.incrementAndGet();
if ( uri1.equals(record.getUri()) ) { assertEquals( "the transform should have changed testProperty to 'test1a'", "test1a", record.getContentAs(JsonNode.class).get("testProperty").textValue() );
"</envelope>"; String actual = finalDocMgr.read("2.xml").next().getContentAs(String.class);
String uri = record.getUri(); String collection = record.getMetadata(new DocumentMetadataHandle()).getCollections().iterator().next(); String contents = record.getContentAs(String.class); return uri + "," + collection + "," + contents;
assertEquals("Wrong number of results", 8, page.size()); for ( DocumentRecord record : page ) { Document doc = record.getContentAs(Document.class); if ( record.getUri().startsWith(prefix + "_1") ) { assertXpathEvaluatesTo("2014-08-19T00:00:00Z", "//valid-start", doc);