@Test public void testVisitAndSend() throws Exception { init(); Exchange exchange = createFileEntryExchange(); processor.setUpState(exchange, exchange.getIn().getBody(FileEntryWorkNote.class)); RecordMetaImpl meta = new RecordMetaImpl("student", "student"); Location loc = Mockito.mock(Location.class); Mockito.when(loc.getLineNumber()).thenReturn(1); Mockito.when(loc.getColumnNumber()).thenReturn(1); meta.setSourceStartLocation(loc); meta.setSourceEndLocation(loc); Map<String, Object> body = new HashMap<String, Object>(); body.put("studentUniqueStateId", "studentId"); processor.visit(meta, body); ParserState state = processor.getState(); List<NeutralRecord> records = state.getDataBatch(); Assert.assertNotNull(records); Assert.assertEquals(1, records.size()); Assert.assertEquals("studentId", records.get(0).getAttributes().get("studentUniqueStateId")); Assert.assertEquals("student", records.get(0).getRecordType()); }
@Override public void visit(RecordMeta recordMeta, Map<String, Object> record) { state.get().addToBatch(recordMeta, record, typeProvider, helper); if (state.get().getDataBatch().size() >= batchSize) { sendDataBatch(); } }
EdFiParserProcessor extends IngestionProcessor<FileEntryWorkNote, IngestionFileEntry> implements
        RecordVisitor { @Override public void visit(RecordMeta recordMeta, Map<String, Object> record) { state.get().addToBatch(recordMeta, record, typeProvider, helper); if (state.get().getDataBatch().size() >= batchSize) { sendDataBatch(); } } }
EdFiParserProcessor extends IngestionProcessor<FileEntryWorkNote, IngestionFileEntry> implements
        RecordVisitor { @Override public void visit(RecordMeta recordMeta, Map<String, Object> record) { state.get().addToBatch(recordMeta, record, typeProvider, helper); if (state.get().getDataBatch().size() >= batchSize) { sendDataBatch(); } }  }
EdFiParserProcessor extends IngestionProcessor<FileEntryWorkNote, IngestionFileEntry> implements
        RecordVisitor { @Override public void visit(RecordMeta recordMeta, Map<String, Object> record) { state.get().addToBatch(recordMeta, record, typeProvider, helper); if (state.get().getDataBatch().size() >= batchSize) { sendDataBatch(); } }  @Override void visit(RecordMeta recordMeta, Map<String, Object> record); @Override void ignored(); void sendDataBatch(); @Override AbstractMessageReport getMessageReport(); @Override void setMessageReport(AbstractMessageReport messageReport); @Override String getStageDescription(); @Override BatchJobStageType getStage(); ProducerTemplate getProducer(); void setProducer(ProducerTemplate producer); TypeProvider getTypeProvider(); void setTypeProvider(TypeProvider typeProvider); XsdSelector getXsdSelector(); void setHelper( ReferenceHelper helper ); void setXsdSelector(XsdSelector xsdSelector); int getBatchSize(); void setBatchSize(int batchSize); void audit(SecurityEvent event); }
EdFiParserProcessor extends IngestionProcessor<FileEntryWorkNote, IngestionFileEntry> implements
        RecordVisitor { @Override public void visit(RecordMeta recordMeta, Map<String, Object> record) { state.get().addToBatch(recordMeta, record, typeProvider, helper); if (state.get().getDataBatch().size() >= batchSize) { sendDataBatch(); } }  @Override void visit(RecordMeta recordMeta, Map<String, Object> record); @Override void ignored(); void sendDataBatch(); @Override AbstractMessageReport getMessageReport(); @Override void setMessageReport(AbstractMessageReport messageReport); @Override String getStageDescription(); @Override BatchJobStageType getStage(); ProducerTemplate getProducer(); void setProducer(ProducerTemplate producer); TypeProvider getTypeProvider(); void setTypeProvider(TypeProvider typeProvider); XsdSelector getXsdSelector(); void setHelper( ReferenceHelper helper ); void setXsdSelector(XsdSelector xsdSelector); int getBatchSize(); void setBatchSize(int batchSize); void audit(SecurityEvent event);  }