RuleDto createNewRule(RulesRegistrationContext context, RulesDefinition.Rule ruleDef) {
    RuleDto newRule = createRuleWithSimpleFields(ruleDef, uuidFactory.create(), system2.now());
    ruleDescriptionSectionsGeneratorResolver.generateFor(ruleDef).forEach(newRule::addRuleDescriptionSectionDto);
    context.created(newRule);
    return newRule;
  }
@Test
  public void from_whenRuleDefinitionDoesntHaveCleanCodeAttribute_shouldAlwaysSetCleanCodeAttribute() {
    RulesDefinition.Rule ruleDef = getDefaultRule();

    RuleDto newRuleDto = underTest.createNewRule(context, ruleDef);

    assertThat(newRuleDto.getCleanCodeAttribute()).isEqualTo(CleanCodeAttribute.CONVENTIONAL);
  }