@Test public void setComment() { IssueChangeNotification result = notification.setComment("My comment"); assertThat(result.getFieldValue("comment")).isEqualTo("My comment"); } }
private IssueDto doSaveIssue(DbSession session, DefaultIssue issue, IssueChangeContext context, @Nullable String comment, Optional<RuleDefinitionDto> rule, ComponentDto project, ComponentDto component) { IssueDto issueDto = issueStorage.save(session, singletonList(issue)).iterator().next(); if (issue.type() != RuleType.SECURITY_HOTSPOT) { String assigneeUuid = issue.assignee(); UserDto assignee = assigneeUuid == null ? null : dbClient.userDao().selectByUuid(session, assigneeUuid); String authorUuid = context.userUuid(); UserDto author = authorUuid == null ? null : dbClient.userDao().selectByUuid(session, authorUuid); notificationService.scheduleForSending(new IssueChangeNotification() .setIssue(issue) .setAssignee(assignee) .setChangeAuthor(author) .setRuleName(rule.map(RuleDefinitionDto::getName).orElse(null)) .setProject(project) .setComponent(component) .setComment(comment)); } return issueDto; }
private IssueDto doSaveIssue(DbSession session, DefaultIssue issue, IssueChangeContext context, @Nullable String comment, Optional<RuleDefinitionDto> rule, ComponentDto project, ComponentDto component) { IssueDto issueDto = issueStorage.save(session, issue); String assigneeUuid = issue.assignee(); UserDto assignee = assigneeUuid == null ? null : dbClient.userDao().selectByUuid(session, assigneeUuid); String authorUuid = context.userUuid(); UserDto author = authorUuid == null ? null : dbClient.userDao().selectByUuid(session, authorUuid); notificationService.scheduleForSending(new IssueChangeNotification() .setIssue(issue) .setAssignee(assignee) .setChangeAuthor(author) .setRuleName(rule.map(RuleDefinitionDto::getName).orElse(null)) .setProject(project) .setComponent(component) .setComment(comment)); return issueDto; }