RuleChange findChangesAndUpdateRule(RulesDefinition.Rule ruleDef, RuleDto ruleDto) {
    RuleChange ruleChange = new RuleChange(ruleDto);
    boolean ruleMerged = mergeRule(ruleDef, ruleDto, ruleChange);
    boolean debtDefinitionsMerged = mergeDebtDefinitions(ruleDef, ruleDto);
    boolean tagsMerged = mergeTags(ruleDef, ruleDto);
    boolean securityStandardsMerged = mergeSecurityStandards(ruleDef, ruleDto);
    boolean educationPrinciplesMerged = mergeEducationPrinciples(ruleDef, ruleDto);
    ruleChange.ruleDefinitionChanged = ruleMerged || debtDefinitionsMerged || tagsMerged || securityStandardsMerged || educationPrinciplesMerged;
    return ruleChange;
  }
@Test
  public void findChangesAndUpdateRule_whenNoCleanCodeTaxonomyChanged_thenPluginRuleChangeShouldBeNull() {
    RulesDefinition.Rule ruleDef = getDefaultRuleDef();
    when(ruleDef.cleanCodeAttribute()).thenReturn(CleanCodeAttribute.COMPLETE);
    Map<SoftwareQuality, Severity> newImpacts = Map.of(SoftwareQuality.MAINTAINABILITY, Severity.LOW);
    when(ruleDef.defaultImpacts()).thenReturn(newImpacts);

    RuleDto rule = getDefaultRuleDto();
    when(rule.getCleanCodeAttribute()).thenReturn(CleanCodeAttribute.COMPLETE);
    Set<ImpactDto> oldImpacts = Set.of(new ImpactDto(SoftwareQuality.MAINTAINABILITY, Severity.LOW));
    when(rule.getDefaultImpacts()).thenReturn(oldImpacts);

    StartupRuleUpdater.RuleChange changesAndUpdateRule = underTest.findChangesAndUpdateRule(ruleDef, rule);

    assertTrue(changesAndUpdateRule.hasRuleDefinitionChanged());
    assertThat(changesAndUpdateRule.getPluginRuleUpdate()).isNull();
  }