Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a framework to easily unit test processing elements #2374

Closed
tenthe opened this issue Dec 27, 2023 · 0 comments · Fixed by #2375 or #2730
Closed

Provide a framework to easily unit test processing elements #2374

tenthe opened this issue Dec 27, 2023 · 0 comments · Fixed by #2375 or #2730
Labels
enhancement New feature or request java Pull requests that update Java code testing Relates to any kind of test (unit test, integration, or E2E test).
Milestone

Comments

@tenthe
Copy link
Contributor

tenthe commented Dec 27, 2023

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 tenthe added enhancement New feature or request java Pull requests that update Java code testing Relates to any kind of test (unit test, integration, or E2E test). labels Dec 27, 2023
@tenthe tenthe added this to the 0.95.0 milestone Dec 27, 2023
@tenthe tenthe linked a pull request Dec 27, 2023 that will close this issue
@bossenti bossenti modified the milestones: 0.95.0, 0.97.0 Apr 8, 2024
IsaakKrut added a commit to IsaakKrut/streampipes that referenced this issue Apr 12, 2024
IsaakKrut added a commit to IsaakKrut/streampipes that referenced this issue Apr 12, 2024
IsaakKrut added a commit to IsaakKrut/streampipes that referenced this issue Apr 12, 2024
IsaakKrut added a commit to IsaakKrut/streampipes that referenced this issue Apr 15, 2024
IsaakKrut added a commit to IsaakKrut/streampipes that referenced this issue Apr 15, 2024
tenthe pushed a commit that referenced this issue Apr 16, 2024
…nts (#2730)

* #2374 refactored unit tests to use ProcessingElementTestExecutor

* #2374 cleanup

* #2374 cleanup

* #2374 updated test executor to non-static methods

* #2374 updated test executor to non-static methods
tenthe added a commit that referenced this issue Apr 29, 2024
tenthe added a commit that referenced this issue May 2, 2024
* feat(#2374): Add suggestion to test processing elements

* #2374 refactored unit tests to use ProcessingElementTestExecutor

* #2374 cleanup

* #2374 cleanup

* #2374 updated test executor to non-static methods

* #2374 updated test executor to non-static methods

* test(#2374): provide a framework to easily unit test processing elements (#2730)

* #2374 refactored unit tests to use ProcessingElementTestExecutor

* #2374 cleanup

* #2374 cleanup

* #2374 updated test executor to non-static methods

* #2374 updated test executor to non-static methods

* #2374 Added test configuration builder and resolved selector prefixes

* #2374 Moved test executor to a new package

* feat(#2374): Fix cyclic dependencies and checkstyle

* feat(#2374): Fix checkstyle

* #2374 extracted TestConfigurationBuilder into a separate file

---------

Co-authored-by: Isaak <krutisaak099@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request java Pull requests that update Java code testing Relates to any kind of test (unit test, integration, or E2E test).
Projects
None yet
2 participants