@Test
public void shouldUpdateViolation() {
Violation violation = Violation.create(rule1, javaFile)
- .setLineId(20).setCost(55.6);
+ .setLineId(20).setCost(55.6).setSeverity(RulePriority.MINOR);
RuleFailureModel model = getSession().getSingleResult(RuleFailureModel.class, "id", 1);
violationPersister.saveOrUpdateViolation(new Project("project"), violation, model, null);
scope="FIL" qualifier="CLA" created_at="2008-11-01 13:58:00.00" version="[null]" path=""
status="U" islast="false" depth="3" />
- <RULE_FAILURES ID="1" SNAPSHOT_ID="1000" RULE_ID="30" FAILURE_LEVEL="3" MESSAGE="old message" LINE="20" COST="55.6" created_at="2008-11-01 13:58:00.00" checksum="[null]"/>
+ <RULE_FAILURES ID="1" SNAPSHOT_ID="1000" RULE_ID="30" FAILURE_LEVEL="1" MESSAGE="old message" LINE="20" COST="55.6" created_at="2008-11-01 13:58:00.00" checksum="[null]"/>
<RULE_FAILURES ID="2" SNAPSHOT_ID="1000" RULE_ID="30" FAILURE_LEVEL="3" MESSAGE="old message" LINE="10" COST="[null]" created_at="2008-11-01 13:58:00.00" checksum="[null]"/>
</dataset>
@Column(name = "rule_id", updatable = false, nullable = false)
private Integer ruleId;
- @Column(name = "failure_level", updatable = false, nullable = false)
+ @Column(name = "failure_level", updatable = true, nullable = false)
@Enumerated(EnumType.ORDINAL)
private RulePriority priority;