import org.sonar.api.server.debt.DebtRemediationFunction;
import javax.annotation.CheckForNull;
-
import java.util.Date;
import java.util.List;
String htmlDescription();
+ String effortToFixDescription();
+
/**
* Default severity when activated on a Quality profile
*
import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
-
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
return getNullableField(RuleNormalizer.RuleField.HTML_DESCRIPTION.field());
}
+ @Override
+ @CheckForNull
+ public String effortToFixDescription() {
+ return getNullableField(RuleNormalizer.RuleField.FIX_DESCRIPTION.field());
+ }
+
@Override
@CheckForNull
public String severity() {
public static final IndexField HTML_DESCRIPTION = addSearchable(IndexField.Type.TEXT, "htmlDesc");
public static final IndexField SEVERITY = add(IndexField.Type.STRING, "severity");
public static final IndexField STATUS = add(IndexField.Type.STRING, "status");
+ public static final IndexField FIX_DESCRIPTION = add(IndexField.Type.STRING, "effortToFix");
public static final IndexField LANGUAGE = add(IndexField.Type.STRING, "lang");
public static final IndexField TAGS = add(IndexField.Type.STRING, "tags");
public static final IndexField SYSTEM_TAGS = add(IndexField.Type.STRING, "sysTags");
update.put(RuleField.CREATED_AT.field(), rule.getCreatedAt());
update.put(RuleField.UPDATED_AT.field(), rule.getUpdatedAt());
update.put(RuleField.HTML_DESCRIPTION.field(), rule.getDescription());
+ update.put(RuleField.FIX_DESCRIPTION.field(), rule.getEffortToFixDescription());
update.put(RuleField.SEVERITY.field(), rule.getSeverityString());
update.put(RuleField.STATUS.field(), rule.getStatus().name());
update.put(RuleField.LANGUAGE.field(), rule.getLanguage());
addField("debtRemFn", new IndexStringField("debtRemFnType", RuleNormalizer.RuleField.DEBT_FUNCTION_TYPE.field()));
addField("debtRemFn", new IndexStringField("debtRemFnCoeff", RuleNormalizer.RuleField.DEBT_FUNCTION_COEFFICIENT.field()));
addField("debtRemFn", new IndexStringField("debtRemFnOffset", RuleNormalizer.RuleField.DEBT_FUNCTION_OFFSET.field()));
+ addIndexStringField("effortToFixDescription", RuleNormalizer.RuleField.FIX_DESCRIPTION.field());
addIndexStringField("mdNote", RuleNormalizer.RuleField.NOTE.field());
addField("htmlNote", new HtmlNoteField(macroInterpreter));
addIndexStringField("noteLogin", RuleNormalizer.RuleField.NOTE_LOGIN.field());
assertThat(hit.isTemplate()).isFalse();
assertThat(hit.tags()).containsOnly("tag1", "tag2");
assertThat(hit.systemTags()).containsOnly("systag1", "systag2");
+ assertThat(hit.effortToFixDescription()).isEqualTo(persistedDto.getEffortToFixDescription());
}
@Test