use of com.sequenceiq.common.api.telemetry.model.AnonymizationRule in project cloudbreak by hortonworks.
the class AccountTelemetryServiceTest method testValidateRulesWithInvalidRules.
@Test
public void testValidateRulesWithInvalidRules() {
// GIVEN
AccountTelemetry telemetry = new AccountTelemetry();
List<AnonymizationRule> rules = new ArrayList<>();
AnonymizationRule rule = new AnonymizationRule();
rule.setReplacement("[REDACTED]");
String pattern = "invalidrule{";
String encodedPattern = new String(Base64.getEncoder().encode(pattern.getBytes()));
rule.setValue(encodedPattern);
rules.add(rule);
telemetry.setRules(rules);
// THEN
assertThrows(BadRequestException.class, () -> {
// WHEN
underTest.validateAnonymizationRules(telemetry);
});
}
Aggregations