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

Add obfuscate_when parameter and tag_on_match failure to obfuscate processor #3509

Closed
wants to merge 0 commits into from

Conversation

graytaylor0
Copy link
Member

@graytaylor0 graytaylor0 commented Oct 16, 2023

Description

Add obfuscate_when parameter to obfuscate processor to support conditionally running obfuscate on Events

Check List

  • New functionality includes testing.
  • New functionality has a documentation issue. Please link to it in this PR.
    • New functionality has javadoc added
  • Commits are signed with a real name per the DCO

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

final List<Record<Event>> editedRecords = (List<Record<Event>>) objectUnderTest.doExecute(Collections.singletonList(record));

assertThat(editedRecords.size(), equalTo(1));
assertThat(editedRecords.get(0), equalTo(record));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this is validating that the event was unmodified.

Ideally, you could verify this with verifyNoInteractions(record.getData(), but this Event is not a mock. So I think you will need another approach. You should be able to call record.getData().toMap() before doExecute.

Then you can assert:

assertThat(editedRecords.get(0).getData().toMap(), equalTo(expectedMap));

@graytaylor0 graytaylor0 changed the title Add obfuscate_when parameter to obfuscate processor Add obfuscate_when parameter and tag_on_match failure to obfuscate processor Oct 20, 2023
@graytaylor0
Copy link
Member Author

New PR for this here (#3544). Had this one on my main branch which was causing issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants