@Test public void testValidateRulesWithoutRules() { AccountTelemetry telemetry = new AccountTelemetry(); underTest.validateAnonymizationRules(telemetry); }
void validateAnonymizationRules(AccountTelemetry telemetry) { Optional.ofNullable(telemetry.getRules()).orElse(new ArrayList<>()) .forEach(rule -> { String decodedRule = new String(Base64.getDecoder().decode(rule.getValue().getBytes())); createAndCheckPattern(decodedRule); }); }
AccountTelemetryService { void validateAnonymizationRules(AccountTelemetry telemetry) { Optional.ofNullable(telemetry.getRules()).orElse(new ArrayList<>()) .forEach(rule -> { String decodedRule = new String(Base64.getDecoder().decode(rule.getValue().getBytes())); createAndCheckPattern(decodedRule); }); } }
AccountTelemetryService { void validateAnonymizationRules(AccountTelemetry telemetry) { Optional.ofNullable(telemetry.getRules()).orElse(new ArrayList<>()) .forEach(rule -> { String decodedRule = new String(Base64.getDecoder().decode(rule.getValue().getBytes())); createAndCheckPattern(decodedRule); }); } AccountTelemetryService(AccountTelemetryRepository accountTelemetryRepository); }
AccountTelemetryService { void validateAnonymizationRules(AccountTelemetry telemetry) { Optional.ofNullable(telemetry.getRules()).orElse(new ArrayList<>()) .forEach(rule -> { String decodedRule = new String(Base64.getDecoder().decode(rule.getValue().getBytes())); createAndCheckPattern(decodedRule); }); } AccountTelemetryService(AccountTelemetryRepository accountTelemetryRepository); AccountTelemetry create(AccountTelemetry telemetry, String accountId); AccountTelemetry getOrDefault(String accountId); Features updateFeatures(String accountId, Features newFeatures); AccountTelemetry createDefaultAccuontTelemetry(); String testRulePatterns(List<AnonymizationRule> rules, String input); }
AccountTelemetryService { void validateAnonymizationRules(AccountTelemetry telemetry) { Optional.ofNullable(telemetry.getRules()).orElse(new ArrayList<>()) .forEach(rule -> { String decodedRule = new String(Base64.getDecoder().decode(rule.getValue().getBytes())); createAndCheckPattern(decodedRule); }); } AccountTelemetryService(AccountTelemetryRepository accountTelemetryRepository); AccountTelemetry create(AccountTelemetry telemetry, String accountId); AccountTelemetry getOrDefault(String accountId); Features updateFeatures(String accountId, Features newFeatures); AccountTelemetry createDefaultAccuontTelemetry(); String testRulePatterns(List<AnonymizationRule> rules, String input);  }