Package org.sonar.api.issue

Examples of org.sonar.api.issue.Issue.ruleKey()


    when(ruleFinder.findByKey(ruleKey)).thenReturn(rule);
    when(rule.getSeverity()).thenReturn(RulePriority.BLOCKER);

    Issue issue = mock(Issue.class);
    when(issue.isNew()).thenReturn(true);
    when(issue.ruleKey()).thenReturn(ruleKey);
    when(issue.message()).thenReturn("issue message");
    when(issue.componentKey()).thenReturn("componentKey");
    when(issue.line()).thenReturn(12);

    List<Issue> issues = new ArrayList<Issue>();
View Full Code Here


    assertThat(issueDoc.assignee()).isEqualTo(issue.getAssignee());
    assertThat(issueDoc.authorLogin()).isEqualTo(issue.getAuthorLogin());
    assertThat(issueDoc.closeDate()).isEqualTo(issue.getIssueCloseDate());
    assertThat(issueDoc.effortToFix()).isEqualTo(issue.getEffortToFix());
    assertThat(issueDoc.resolution()).isEqualTo(issue.getResolution());
    assertThat(issueDoc.ruleKey()).isEqualTo(RuleKey.of(issue.getRuleRepo(), issue.getRule()));
    assertThat(issueDoc.line()).isEqualTo(issue.getLine());
    assertThat(issueDoc.message()).isEqualTo(issue.getMessage());
    assertThat(issueDoc.reporter()).isEqualTo(issue.getReporter());
    assertThat(issueDoc.key()).isEqualTo(issue.getKey());
    assertThat(issueDoc.updateDate()).isEqualTo(issue.getIssueUpdateDate());
View Full Code Here

      .message("Foo")
      .overrideSeverity(Severity.BLOCKER)
      .effortToFix(10.0));

    Issue issue = argumentCaptor.getValue();
    assertThat(issue.ruleKey()).isEqualTo(RuleKey.of("foo", "bar"));
    assertThat(issue.message()).isEqualTo("Foo");
    assertThat(issue.line()).isNull();
    assertThat(issue.severity()).isEqualTo("BLOCKER");
    assertThat(issue.effortToFix()).isEqualTo(10.0);
  }
View Full Code Here

      .message("Foo")
      .atLine(3)
      .effortToFix(10.0));

    Issue issue = argumentCaptor.getValue();
    assertThat(issue.ruleKey()).isEqualTo(RuleKey.of("foo", "bar"));
    assertThat(issue.message()).isEqualTo("Foo");
    assertThat(issue.line()).isEqualTo(3);
    assertThat(issue.severity()).isNull();
    assertThat(issue.effortToFix()).isEqualTo(10.0);
  }
View Full Code Here

      .ruleKey(RuleKey.of("foo", "bar"))
      .message("Foo")
      .effortToFix(10.0));

    Issue issue = argumentCaptor.getValue();
    assertThat(issue.ruleKey()).isEqualTo(RuleKey.of("foo", "bar"));
    assertThat(issue.message()).isEqualTo("Foo");
    assertThat(issue.line()).isNull();
    assertThat(issue.severity()).isNull();
    assertThat(issue.effortToFix()).isEqualTo(10.0);
  }
View Full Code Here

    Issue mockIssue = mock(Issue.class);
    RuleKey ruleKey = null;
    if (rule != null) {
      ruleKey = rule.ruleKey();
    }
    when(mockIssue.ruleKey()).thenReturn(ruleKey);
    when(mockIssue.componentKey()).thenReturn(component);
    when(mockIssue.line()).thenReturn(line);
    return mockIssue;
  }
View Full Code Here

    Issue mockIssue = mock(Issue.class);
    RuleKey ruleKey = null;
    if (rule != null) {
      ruleKey = rule.ruleKey();
    }
    when(mockIssue.ruleKey()).thenReturn(ruleKey);
    when(mockIssue.componentKey()).thenReturn(component);
    when(mockIssue.line()).thenReturn(line);
    return mockIssue;
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.