@VisibleForTesting
  void mergeFields(IssueDto dbIssue, DefaultIssue issue) {
    resolveAssignee(dbIssue, issue);
    resolveSeverity(dbIssue, issue);
    resolveEffortToFix(dbIssue, issue);
    resolveResolution(dbIssue, issue);
    resolveStatus(dbIssue, issue);
  }
@Test
  public void severity_changed_by_user_should_be_kept() {
    DefaultIssue issue = new DefaultIssue()
      .setKey("ABCDE")
      .setRuleKey(RuleKey.of("java", "AvoidCycles"))
      .setComponentKey("struts:org.apache.struts.Action")
      .setNew(false)
      .setStatus(STATUS_OPEN);

    // Changed by scan
    issue.setSeverity(Severity.BLOCKER);
    issue.setManualSeverity(false);

    // Issue as seen and changed by end-user
    IssueDto dbIssue = new IssueDto()
      .setKee("ABCDE")
      .setStatus(STATUS_OPEN)
      .setSeverity(Severity.INFO)
      .setManualSeverity(true);

    underTest.mergeFields(dbIssue, issue);

    assertThat(issue.severity()).isEqualTo(Severity.INFO);
    assertThat(issue.manualSeverity()).isTrue();
  }