Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ boolean hasOnlyOneConfiguration() {

@AssertTrue(message = "exclude_from_delete only applies when with_keys_regex is configured.")
boolean isExcludeFromDeleteValid() {
return excludeFromDelete != null && !excludeFromDelete.isEmpty() && withKeysRegex != null && !withKeysRegex.isEmpty();
return !((excludeFromDelete != null && !excludeFromDelete.isEmpty()) && (withKeysRegex == null || withKeysRegex.isEmpty()));
}

@JsonIgnore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@ void testisExcludeFromDeleteValid_with_valid_config() throws NoSuchFieldExceptio
assertThat(objectUnderTest.isExcludeFromDeleteValid(), equalTo(true));
}

@Test
void test_with_keys_valid_config() throws NoSuchFieldException, IllegalAccessException{
final DeleteEntryProcessorConfig objectUnderTest = new DeleteEntryProcessorConfig();
final List<String> regexKeys = List.of("test.*");
ReflectivelySetField.setField(DeleteEntryProcessorConfig.class, objectUnderTest, "withKeys", regexKeys);

assertThat(objectUnderTest.isExcludeFromDeleteValid(), equalTo(true));
}

@Test
void testisExcludeFromDeleteValid_with_invalid_config() throws NoSuchFieldException, IllegalAccessException{
final DeleteEntryProcessorConfig objectUnderTest = new DeleteEntryProcessorConfig();
Expand Down
Loading