@Override
    public void define(Context context) {
      if (includeX1
          || includeX1bis
          || includeX2
          || includeTemplate1
          || includeRuleLinkedToRootCharacteristic) {
        NewRepository repository = context.createRepository("xoo", "xoo").setName("Xoo Repo");
        if (includeX1) {
          NewRule x1Rule =
              repository
                  .createRule(RuleTesting.XOO_X1.rule())
                  .setName("x1 name")
                  .setHtmlDescription("x1 desc")
                  .setSeverity(Severity.MINOR)
                  .setEffortToFixDescription("x1 effort to fix")
                  .setTags("tag1");
          x1Rule
              .createParam("acceptWhitespace")
              .setType(RuleParamType.BOOLEAN)
              .setDefaultValue("false")
              .setDescription("Accept whitespaces on the line");
          x1Rule
              .setDebtSubCharacteristic(SubCharacteristics.INTEGRATION_TESTABILITY)
              .setDebtRemediationFunction(
                  x1Rule.debtRemediationFunctions().linearWithOffset("1h", "30min"));
        }

        // X1 having fields updated to simulate an update from the plugin
        if (includeX1bis) {
          NewRule x1Rule =
              repository
                  .createRule(RuleTesting.XOO_X1.rule())
                  .setName("x1 name updated")
                  .setHtmlDescription("x1 desc updated")
                  .setSeverity(Severity.INFO)
                  .setEffortToFixDescription("x1 effort to fix updated")
                  .setTags("tag1", "tag2", "user-tag");
          x1Rule
              .createParam("acceptWhitespace")
              .setType(RuleParamType.BOOLEAN)
              .setDefaultValue("true")
              .setDescription("Accept whitespaces on the line updated");
          // New param
          x1Rule
              .createParam("format")
              .setType(RuleParamType.TEXT)
              .setDefaultValue("txt")
              .setDescription("Format");
          x1Rule
              .setDebtSubCharacteristic(SubCharacteristics.INSTRUCTION_RELIABILITY)
              .setDebtRemediationFunction(x1Rule.debtRemediationFunctions().linear("2h"));
        }

        if (includeX2) {
          repository
              .createRule(RuleTesting.XOO_X2.rule())
              .setName("x2 name")
              .setHtmlDescription("x2 desc")
              .setSeverity(Severity.MAJOR);
        }

        if (includeRuleLinkedToRootCharacteristic) {
          NewRule x1Rule =
              repository
                  .createRule("RuleLinkedToRootCharacteristic")
                  .setName("RuleLinkedToRootCharacteristic name")
                  .setHtmlDescription("RuleLinkedToRootCharacteristic desc")
                  .setSeverity(Severity.MINOR);
          x1Rule
              // Link to a root characteristic -> fail
              .setDebtSubCharacteristic("REUSABILITY")
              .setDebtRemediationFunction(
                  x1Rule.debtRemediationFunctions().linearWithOffset("1h", "30min"));
        }

        if (includeTemplate1) {
          repository
              .createRule("template1")
              .setName("template1 name")
              .setHtmlDescription("template1 desc")
              .setSeverity(Severity.MAJOR)
              .setTemplate(true)
              .createParam("format")
              .setDefaultValue("csv")
              .setType(RuleParamType.STRING)
              .setDescription("format parameter");
        }

        repository.done();
      }
    }