@Test public void shouldInitRemoteIssueWithComponent() throws Exception { // Given that settings.setProperty(JiraConstants.JIRA_ISSUE_COMPONENT_ID, "123"); RemoteIssue expectedIssue = new RemoteIssue(); expectedIssue.setProject("TEST"); expectedIssue.setType("3"); expectedIssue.setPriority("4"); expectedIssue.setSummary("Sonar Issue #ABCD - Avoid cycle between java packages"); expectedIssue.setDescription( "Issue detail:\n{quote}\nThe Cyclomatic Complexity of this method is 14 which is greater than 10 authorized.\n" + "{quote}\n\n\nCheck it on Sonar: http://my.sonar.com/issue/show/ABCD"); expectedIssue.setComponents(new RemoteComponent[] {new RemoteComponent("123", null)}); // Verify RemoteIssue returnedIssue = jiraIssueCreator.initRemoteIssue(sonarIssue, settings, ""); assertThat(returnedIssue).isEqualTo(expectedIssue); }