No need to inherit off of AbstractRecordReader for a processor. Just look
through some of the bundles on my GitHub profile to see some that use
vanilla AbstractProcessor and set everything up without any messy
inheritance beyond that.

https://github.com/MikeThomsen/

On Sun, Sep 8, 2019 at 1:04 PM Peter Thygesen <[email protected]>
wrote:

> No. That is exactly the problem.
>
> E.g.
>
> runner = TestRunners.newTestRunner(OpenNLPRecordProcessor.class);
> runner.addControllerService("reader", readerService);
> runner.enableControllerService(readerService);
>
> runner.setProperty(OpenNLPRecordProcessor.RECORD_READER, "reader");
>
> Last line will not compile! You cannot refer to the RECORD_READER because
> its "private package". That means I have to move my processor to same
> package or create my own READER (leaving the original reader not used, but
> initiated)
>
> On 2019/09/08 14:41:09, Otto Fowler <[email protected]> wrote:
> > Have a look at :>
> >
> > import org.apache.nifi.serialization.record.MockRecordParser;>
> > import org.apache.nifi.serialization.record.MockRecordWriter;>
> >
> > Maybe?>
> >
> >
> >
> > On September 8, 2019 at 06:53:10, Peter Thygesen (
> [email protected])>
>
> > wrote:>
> >
> > Hi Nifi-Dev>
> >
> > I am trying to write a custom record processor. My processor extends>
> > AbstractRecordProcessor. To test my processor I need to mock reader and>
> > writer , but that is not easybecause the RecordReader and RecordWriter
> of>
> > the AbstractRecordReader are static private package scope, which makes
> it>
> > impossible to mock since my processor is not in the same package...>
> >
> > Any tips?>
> >
> > Best Regards,>
> > Peter Thygesen>
> >
>

Reply via email to