streampipes icon indicating copy to clipboard operation
streampipes copied to clipboard

Provide a framework to easily unit test processing elements

Open tenthe opened this issue 1 year ago • 0 comments

Body

Description

It is currently challenging for developers to write unit tests for processing elements. A dedicated test framework is needed to facilitate testing with various user inputs efficiently. The focus should be on extensive testing of the onEvent method.

Proposed API

var processor = new ProcessingElementUnderTest();
 
var userConfiguration = Map.of("key-textFIlter", "text");
 
var inputEvents = List.of(
     new Event(),
     new Event()
 );
 
var expectedOutputEvents = List.of(
     new Event(),
     new Event()
 );
 
ProcessingElementTestExecuter.run(processingElement, userConfiguration, inputEvents, expectedOutputEvents);

StreamPipes Committer

I acknowledge that I am a maintainer/committer of the Apache StreamPipes project.

tenthe avatar Dec 27 '23 10:12 tenthe