FlowConnector flowConnector = platform.makeFlowConnector();
Flow flow = flowConnector.connect(in, FetchPipe.makeSinkMap(status, content), fetchPipe);
flow.complete();
Tap validate = platform.makeTap(platform.makeBinaryScheme(FetchedDatum.FIELDS), contentPath);
TupleEntryIterator tupleEntryIterator = validate.openForRead(platform.makeFlowProcess());
int totalEntries = 0;
while (tupleEntryIterator.hasNext()) {
TupleEntry entry = tupleEntryIterator.next();
totalEntries += 1;
FetchedDatum datum = new FetchedDatum(entry);
String payloadValue = (String)datum.getPayloadValue("key");
Assert.assertNotNull(payloadValue);
Assert.assertEquals("value", payloadValue);
}
Assert.assertEquals(1, totalEntries);
tupleEntryIterator.close();
validate = platform.makeTap(platform.makeBinaryScheme(StatusDatum.FIELDS), statusPath);
tupleEntryIterator = validate.openForRead(platform.makeFlowProcess());
totalEntries = 0;
while (tupleEntryIterator.hasNext()) {
TupleEntry entry = tupleEntryIterator.next();
totalEntries += 1;
// Verify we can convert properly
StatusDatum sd = new StatusDatum(entry);
Assert.assertEquals(UrlStatus.FETCHED, sd.getStatus());