public void createQprofileChangesForRuleUpdates(DbSession dbSession, Set<PluginRuleUpdate> pluginRuleUpdates) {
    List<QProfileChangeDto> changesToPersist = pluginRuleUpdates.stream()
      .flatMap(pluginRuleUpdate -> {
        RuleChangeDto ruleChangeDto = createNewRuleChange(pluginRuleUpdate);
        insertRuleChange(dbSession, ruleChangeDto);

        return findQualityProfilesForRule(dbSession, pluginRuleUpdate.getRuleUuid()).stream()
          .map(qualityProfileUuid -> buildQprofileChangeDtoForRuleChange(qualityProfileUuid, ruleChangeDto));
      }).toList();

    if (!changesToPersist.isEmpty()) {
      dbClient.qProfileChangeDao().bulkInsert(dbSession, changesToPersist);
    }
  }
@Test
  public void updateWithoutCommit_whenOneRuleChangedItsAttribute_thenInsertRuleChangeButNotImpactChange() {
    PluginRuleUpdate pluginRuleUpdate = new PluginRuleUpdate();
    pluginRuleUpdate.setNewCleanCodeAttribute(CleanCodeAttribute.CLEAR);
    pluginRuleUpdate.setOldCleanCodeAttribute(CleanCodeAttribute.TESTED);
    pluginRuleUpdate.setRuleUuid(RULE_UUID);

    underTest.createQprofileChangesForRuleUpdates(dbSession, Set.of(pluginRuleUpdate));

    verify(ruleChangeDao).insert(argThat(dbSession::equals), argThat(ruleChangeDto ->
      ruleChangeDto.getNewCleanCodeAttribute() == CleanCodeAttribute.CLEAR
        && ruleChangeDto.getOldCleanCodeAttribute() == CleanCodeAttribute.TESTED
        && ruleChangeDto.getRuleUuid().equals(RULE_UUID)
        && ruleChangeDto.getRuleImpactChanges().isEmpty()));
  }