From 53430982c1c63b764be3f25177cefaeed4db38df Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Fri, 1 Sep 2017 10:44:28 +0200 Subject: [PATCH] SONAR-9616 Fix notification on branch --- .../step/SendIssueNotificationsStep.java | 27 +++- .../notification/IssueChangeNotification.java | 9 +- .../component/ReportComponent.java | 5 +- .../step/SendIssueNotificationsStepTest.java | 142 ++++++++++++------ .../IssueChangeNotificationTest.java | 1 - 5 files changed, 134 insertions(+), 50 deletions(-) diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/task/projectanalysis/step/SendIssueNotificationsStep.java b/server/sonar-server/src/main/java/org/sonar/server/computation/task/projectanalysis/step/SendIssueNotificationsStep.java index 95e83be4a24..32d0b4a1abc 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/computation/task/projectanalysis/step/SendIssueNotificationsStep.java +++ b/server/sonar-server/src/main/java/org/sonar/server/computation/task/projectanalysis/step/SendIssueNotificationsStep.java @@ -19,16 +19,22 @@ */ package org.sonar.server.computation.task.projectanalysis.step; +import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import java.util.Date; +import java.util.HashMap; import java.util.Map; +import java.util.Optional; import java.util.Set; import org.sonar.core.issue.DefaultIssue; import org.sonar.core.util.CloseableIterator; import org.sonar.server.computation.task.projectanalysis.analysis.AnalysisMetadataHolder; import org.sonar.server.computation.task.projectanalysis.analysis.Branch; import org.sonar.server.computation.task.projectanalysis.component.Component; +import org.sonar.server.computation.task.projectanalysis.component.CrawlerDepthLimit; +import org.sonar.server.computation.task.projectanalysis.component.DepthTraversalTypeAwareCrawler; import org.sonar.server.computation.task.projectanalysis.component.TreeRootHolder; +import org.sonar.server.computation.task.projectanalysis.component.TypeAwareVisitorAdapter; import org.sonar.server.computation.task.projectanalysis.issue.IssueCache; import org.sonar.server.computation.task.projectanalysis.issue.RuleRepository; import org.sonar.server.computation.task.step.ComputationStep; @@ -39,6 +45,8 @@ import org.sonar.server.issue.notification.NewIssuesNotificationFactory; import org.sonar.server.issue.notification.NewIssuesStatistics; import org.sonar.server.notification.NotificationService; +import static org.sonar.server.computation.task.projectanalysis.component.ComponentVisitor.Order.POST_ORDER; + /** * Reads issues from disk cache and send related notifications. For performance reasons, * the standard notification DB queue is not used as a temporary storage. Notifications @@ -55,7 +63,8 @@ public class SendIssueNotificationsStep implements ComputationStep { private final TreeRootHolder treeRootHolder; private final NotificationService service; private final AnalysisMetadataHolder analysisMetadataHolder; - private NewIssuesNotificationFactory newIssuesNotificationFactory; + private final NewIssuesNotificationFactory newIssuesNotificationFactory; + private Map componentsByDbKey = new HashMap<>(); public SendIssueNotificationsStep(IssueCache issueCache, RuleRepository rules, TreeRootHolder treeRootHolder, NotificationService service, AnalysisMetadataHolder analysisMetadataHolder, @@ -107,6 +116,7 @@ public class SendIssueNotificationsStep implements ComputationStep { changeNotification.setRuleName(rules.getByKey(issue.ruleKey()).getName()); changeNotification.setIssue(issue); changeNotification.setProject(project.getPublicKey(), project.getName(), getBranchName()); + getComponentKey(issue).ifPresent(c -> changeNotification.setComponent(c.getPublicKey(), c.getName())); service.deliver(changeNotification); } @@ -139,6 +149,21 @@ public class SendIssueNotificationsStep implements ComputationStep { } } + private Optional getComponentKey(DefaultIssue issue) { + if (componentsByDbKey.isEmpty()) { + final ImmutableMap.Builder builder = ImmutableMap.builder(); + new DepthTraversalTypeAwareCrawler( + new TypeAwareVisitorAdapter(CrawlerDepthLimit.LEAVES, POST_ORDER) { + @Override + public void visitAny(Component component) { + builder.put(component.getKey(), component); + } + }).visit(this.treeRootHolder.getRoot()); + this.componentsByDbKey = builder.build(); + } + return Optional.ofNullable(componentsByDbKey.get(issue.componentKey())); + } + @Override public String getDescription() { return "Send issue notifications"; diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/notification/IssueChangeNotification.java b/server/sonar-server/src/main/java/org/sonar/server/issue/notification/IssueChangeNotification.java index 89eb60b9013..477bde3049c 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/issue/notification/IssueChangeNotification.java +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/notification/IssueChangeNotification.java @@ -41,7 +41,6 @@ public class IssueChangeNotification extends Notification { setFieldValue("key", issue.key()); setFieldValue("assignee", issue.assignee()); setFieldValue("message", issue.message()); - setFieldValue("componentKey", issue.componentKey()); FieldDiffs currentChange = issue.currentChange(); if (currentChange != null) { for (Map.Entry entry : currentChange.diffs().entrySet()) { @@ -68,8 +67,12 @@ public class IssueChangeNotification extends Notification { } public IssueChangeNotification setComponent(ComponentDto component) { - setFieldValue("componentName", component.longName()); - setFieldValue("componentKey", component.getKey()); + return setComponent(component.getKey(), component.longName()); + } + + public IssueChangeNotification setComponent(String componentKey, String componentName) { + setFieldValue("componentName", componentName); + setFieldValue("componentKey", componentKey); return this; } diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/task/projectanalysis/component/ReportComponent.java b/server/sonar-server/src/test/java/org/sonar/server/computation/task/projectanalysis/component/ReportComponent.java index 3ebeabcc647..ea06ce4dd15 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/task/projectanalysis/component/ReportComponent.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/task/projectanalysis/component/ReportComponent.java @@ -77,7 +77,7 @@ public class ReportComponent implements Component { public Type getType() { return type; } - + @Override public Status getStatus() { return status; @@ -176,7 +176,8 @@ public class ReportComponent implements Component { } public static Builder builder(Type type, int ref) { - return new Builder(type, ref).setKey("key_" + ref).setPublicKey("public_" + ref).setUuid("uuid_" + ref); + String key = "key_" + ref; + return new Builder(type, ref).setKey(key).setPublicKey(key).setUuid("uuid_" + ref).setName("name_" + ref); } public static final class Builder { diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/task/projectanalysis/step/SendIssueNotificationsStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/task/projectanalysis/step/SendIssueNotificationsStepTest.java index 6b3115688c0..824c72a9129 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/task/projectanalysis/step/SendIssueNotificationsStepTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/task/projectanalysis/step/SendIssueNotificationsStepTest.java @@ -24,18 +24,22 @@ import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; +import org.mockito.ArgumentCaptor; import org.sonar.api.notifications.Notification; import org.sonar.api.rule.Severity; import org.sonar.api.utils.Duration; import org.sonar.api.utils.System2; import org.sonar.core.issue.DefaultIssue; +import org.sonar.db.component.ComponentDto; +import org.sonar.db.rule.RuleDefinitionDto; import org.sonar.server.computation.task.projectanalysis.analysis.AnalysisMetadataHolderRule; +import org.sonar.server.computation.task.projectanalysis.analysis.Branch; import org.sonar.server.computation.task.projectanalysis.component.Component; import org.sonar.server.computation.task.projectanalysis.component.Component.Type; import org.sonar.server.computation.task.projectanalysis.component.DefaultBranchImpl; import org.sonar.server.computation.task.projectanalysis.component.TreeRootHolderRule; import org.sonar.server.computation.task.projectanalysis.issue.IssueCache; -import org.sonar.server.computation.task.projectanalysis.issue.RuleRepository; +import org.sonar.server.computation.task.projectanalysis.issue.RuleRepositoryRule; import org.sonar.server.computation.task.step.ComputationStep; import org.sonar.server.issue.notification.IssueChangeNotification; import org.sonar.server.issue.notification.MyNewIssuesNotification; @@ -44,6 +48,7 @@ import org.sonar.server.issue.notification.NewIssuesNotificationFactory; import org.sonar.server.issue.notification.NewIssuesStatistics; import org.sonar.server.notification.NotificationService; +import static org.assertj.core.api.Java6Assertions.assertThat; import static org.mockito.Matchers.anyString; import static org.mockito.Matchers.eq; import static org.mockito.Mockito.any; @@ -52,16 +57,17 @@ import static org.mockito.Mockito.never; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; +import static org.sonar.db.component.ComponentTesting.newBranchDto; +import static org.sonar.db.component.ComponentTesting.newFileDto; +import static org.sonar.db.component.ComponentTesting.newPrivateProjectDto; +import static org.sonar.db.component.ComponentTesting.newProjectBranch; +import static org.sonar.db.issue.IssueTesting.newIssue; +import static org.sonar.db.organization.OrganizationTesting.newOrganizationDto; +import static org.sonar.db.rule.RuleTesting.newRule; import static org.sonar.server.computation.task.projectanalysis.component.ReportComponent.builder; public class SendIssueNotificationsStepTest extends BaseStepTest { - private static final String PROJECT_UUID = "PROJECT_UUID"; - private static final String PROJECT_KEY = "PROJECT_KEY"; - private static final String PROJECT_NAME = "PROJECT_NAME"; - - private static final String BRANCH_COMPONENT_UUID = "BRANCH_UUID"; - private static final String BRANCH_COMPONENT_NAME = "BRANCH_NAME"; private static final String BRANCH_NAME = "feature"; private static final long ANALYSE_DATE = 123L; @@ -69,8 +75,8 @@ public class SendIssueNotificationsStepTest extends BaseStepTest { private static final Duration ISSUE_DURATION = Duration.create(100L); private static final String ISSUE_ASSIGNEE = "John"; - private static final Component PROJECT = builder(Type.PROJECT, 1).setUuid(PROJECT_UUID).setPublicKey(PROJECT_KEY).setName(PROJECT_NAME).build(); - private static final Component BRANCH = builder(Type.PROJECT, 2).setUuid(BRANCH_COMPONENT_UUID).setPublicKey(PROJECT_KEY).setName(BRANCH_COMPONENT_NAME).build(); + private static final Component FILE = builder(Component.Type.FILE, 11).build(); + private static final Component PROJECT = builder(Type.PROJECT, 1).addChildren(FILE).build(); @Rule public TreeRootHolderRule treeRootHolder = new TreeRootHolderRule() @@ -81,21 +87,24 @@ public class SendIssueNotificationsStepTest extends BaseStepTest { .setBranch(new DefaultBranchImpl()) .setAnalysisDate(new Date(ANALYSE_DATE)); + @Rule + public RuleRepositoryRule ruleRepository = new RuleRepositoryRule(); + @Rule public TemporaryFolder temp = new TemporaryFolder(); - NotificationService notificationService = mock(NotificationService.class); - NewIssuesNotificationFactory newIssuesNotificationFactory = mock(NewIssuesNotificationFactory.class); - NewIssuesNotification newIssuesNotificationMock = createNewIssuesNotificationMock(); - MyNewIssuesNotification myNewIssuesNotificationMock = createMyNewIssuesNotificationMock(); + private NotificationService notificationService = mock(NotificationService.class); + private NewIssuesNotificationFactory newIssuesNotificationFactory = mock(NewIssuesNotificationFactory.class); + private NewIssuesNotification newIssuesNotificationMock = createNewIssuesNotificationMock(); + private MyNewIssuesNotification myNewIssuesNotificationMock = createMyNewIssuesNotificationMock(); - IssueCache issueCache; - SendIssueNotificationsStep underTest; + private IssueCache issueCache; + private SendIssueNotificationsStep underTest; @Before public void setUp() throws Exception { issueCache = new IssueCache(temp.newFile(), System2.INSTANCE); - underTest = new SendIssueNotificationsStep(issueCache, mock(RuleRepository.class), treeRootHolder, notificationService, analysisMetadataHolder, + underTest = new SendIssueNotificationsStep(issueCache, ruleRepository, treeRootHolder, notificationService, analysisMetadataHolder, newIssuesNotificationFactory); when(newIssuesNotificationFactory.newNewIssuesNotication()).thenReturn(newIssuesNotificationMock); @@ -104,7 +113,7 @@ public class SendIssueNotificationsStepTest extends BaseStepTest { @Test public void do_not_send_notifications_if_no_subscribers() { - when(notificationService.hasProjectSubscribersForTypes(PROJECT_UUID, SendIssueNotificationsStep.NOTIF_TYPES)).thenReturn(false); + when(notificationService.hasProjectSubscribersForTypes(PROJECT.getUuid(), SendIssueNotificationsStep.NOTIF_TYPES)).thenReturn(false); underTest.execute(); @@ -114,73 +123,113 @@ public class SendIssueNotificationsStepTest extends BaseStepTest { @Test public void send_global_new_issues_notification() throws Exception { issueCache.newAppender().append( - new DefaultIssue().setSeverity(Severity.BLOCKER).setEffort(ISSUE_DURATION) - ).close(); + new DefaultIssue().setSeverity(Severity.BLOCKER).setEffort(ISSUE_DURATION)).close(); - when(notificationService.hasProjectSubscribersForTypes(PROJECT_UUID, SendIssueNotificationsStep.NOTIF_TYPES)).thenReturn(true); + when(notificationService.hasProjectSubscribersForTypes(PROJECT.getUuid(), SendIssueNotificationsStep.NOTIF_TYPES)).thenReturn(true); underTest.execute(); verify(notificationService).deliver(any(NewIssuesNotification.class)); - verify(newIssuesNotificationMock).setProject(PROJECT_KEY, PROJECT_UUID, PROJECT_NAME, null); + verify(newIssuesNotificationMock).setProject(PROJECT.getPublicKey(), PROJECT.getUuid(), PROJECT.getName(), null); verify(newIssuesNotificationMock).setAnalysisDate(new Date(ANALYSE_DATE)); - verify(newIssuesNotificationMock).setStatistics(eq(PROJECT_NAME), any(NewIssuesStatistics.Stats.class)); + verify(newIssuesNotificationMock).setStatistics(eq(PROJECT.getName()), any(NewIssuesStatistics.Stats.class)); verify(newIssuesNotificationMock).setDebt(ISSUE_DURATION); } @Test public void send_global_new_issues_notification_on_branch() throws Exception { + ComponentDto project = newPrivateProjectDto(newOrganizationDto()); + ComponentDto branch = newProjectBranch(project, newBranchDto(project).setKey(BRANCH_NAME)); + ComponentDto file = newFileDto(branch); + treeRootHolder.setRoot(builder(Type.PROJECT, 2).setKey(branch.getDbKey()).setPublicKey(branch.getKey()).setName(branch.longName()).setUuid(branch.uuid()).addChildren( + builder(Component.Type.FILE, 11).setKey(file.getDbKey()).setPublicKey(file.getKey()).setName(file.longName()).build() + ).build()); issueCache.newAppender().append( - new DefaultIssue().setSeverity(Severity.BLOCKER).setEffort(ISSUE_DURATION) - ).close(); + new DefaultIssue().setSeverity(Severity.BLOCKER).setEffort(ISSUE_DURATION)).close(); - when(notificationService.hasProjectSubscribersForTypes(BRANCH_COMPONENT_UUID, SendIssueNotificationsStep.NOTIF_TYPES)).thenReturn(true); - - analysisMetadataHolder.setBranch(new DefaultBranchImpl(BRANCH_NAME) { - @Override - public boolean isMain() { - return false; - } - }); - treeRootHolder.setRoot(BRANCH); + when(notificationService.hasProjectSubscribersForTypes(branch.uuid(), SendIssueNotificationsStep.NOTIF_TYPES)).thenReturn(true); + analysisMetadataHolder.setBranch(newBranch()); underTest.execute(); verify(notificationService).deliver(any(NewIssuesNotification.class)); - verify(newIssuesNotificationMock).setProject(PROJECT_KEY, BRANCH_COMPONENT_UUID, BRANCH_COMPONENT_NAME, BRANCH_NAME); + verify(newIssuesNotificationMock).setProject(branch.getKey(), branch.uuid(), branch.longName(), BRANCH_NAME); verify(newIssuesNotificationMock).setAnalysisDate(new Date(ANALYSE_DATE)); - verify(newIssuesNotificationMock).setStatistics(eq(BRANCH_COMPONENT_NAME), any(NewIssuesStatistics.Stats.class)); + verify(newIssuesNotificationMock).setStatistics(eq(branch.longName()), any(NewIssuesStatistics.Stats.class)); verify(newIssuesNotificationMock).setDebt(ISSUE_DURATION); } @Test public void send_new_issues_notification_to_user() throws Exception { issueCache.newAppender().append( - new DefaultIssue().setSeverity(Severity.BLOCKER).setEffort(ISSUE_DURATION).setAssignee(ISSUE_ASSIGNEE) - ).close(); + new DefaultIssue().setSeverity(Severity.BLOCKER).setEffort(ISSUE_DURATION).setAssignee(ISSUE_ASSIGNEE)).close(); - when(notificationService.hasProjectSubscribersForTypes(PROJECT_UUID, SendIssueNotificationsStep.NOTIF_TYPES)).thenReturn(true); + when(notificationService.hasProjectSubscribersForTypes(PROJECT.getUuid(), SendIssueNotificationsStep.NOTIF_TYPES)).thenReturn(true); underTest.execute(); verify(notificationService, times(2)).deliver(any(Notification.class)); verify(myNewIssuesNotificationMock).setAssignee(ISSUE_ASSIGNEE); - verify(myNewIssuesNotificationMock).setProject(PROJECT_KEY, PROJECT_UUID, PROJECT_NAME, null); + verify(myNewIssuesNotificationMock).setProject(PROJECT.getPublicKey(), PROJECT.getUuid(), PROJECT.getName(), null); verify(myNewIssuesNotificationMock).setAnalysisDate(new Date(ANALYSE_DATE)); - verify(myNewIssuesNotificationMock).setStatistics(eq(PROJECT_NAME), any(NewIssuesStatistics.Stats.class)); + verify(myNewIssuesNotificationMock).setStatistics(eq(PROJECT.getName()), any(NewIssuesStatistics.Stats.class)); verify(myNewIssuesNotificationMock).setDebt(ISSUE_DURATION); } @Test public void send_issues_change_notification() throws Exception { - DefaultIssue issue = new DefaultIssue().setSeverity(Severity.BLOCKER).setEffort(ISSUE_DURATION).setChanged(true).setSendNotifications(true); + ComponentDto project = newPrivateProjectDto(newOrganizationDto()).setDbKey(PROJECT.getKey()).setLongName(PROJECT.getName()); + ComponentDto file = newFileDto(project).setDbKey(FILE.getKey()).setLongName(FILE.getName()); + RuleDefinitionDto ruleDefinitionDto = newRule(); + DefaultIssue issue = newIssue(ruleDefinitionDto, project, file).toDefaultIssue() + .setNew(false) + .setChanged(true) + .setSendNotifications(true); + ruleRepository.add(ruleDefinitionDto.getKey()).setName(ruleDefinitionDto.getName()); issueCache.newAppender().append(issue).close(); + when(notificationService.hasProjectSubscribersForTypes(PROJECT.getUuid(), SendIssueNotificationsStep.NOTIF_TYPES)).thenReturn(true); + + underTest.execute(); - when(notificationService.hasProjectSubscribersForTypes(PROJECT_UUID, SendIssueNotificationsStep.NOTIF_TYPES)).thenReturn(true); + ArgumentCaptor issueChangeNotificationCaptor = ArgumentCaptor.forClass(IssueChangeNotification.class); + verify(notificationService).deliver(issueChangeNotificationCaptor.capture()); + assertThat(issueChangeNotificationCaptor.getValue().getFieldValue("key")).isEqualTo(issue.key()); + assertThat(issueChangeNotificationCaptor.getValue().getFieldValue("assignee")).isEqualTo(issue.assignee()); + assertThat(issueChangeNotificationCaptor.getValue().getFieldValue("message")).isEqualTo(issue.message()); + assertThat(issueChangeNotificationCaptor.getValue().getFieldValue("ruleName")).isEqualTo(ruleDefinitionDto.getName()); + assertThat(issueChangeNotificationCaptor.getValue().getFieldValue("projectName")).isEqualTo(project.longName()); + assertThat(issueChangeNotificationCaptor.getValue().getFieldValue("projectKey")).isEqualTo(project.getKey()); + assertThat(issueChangeNotificationCaptor.getValue().getFieldValue("componentKey")).isEqualTo(file.getKey()); + assertThat(issueChangeNotificationCaptor.getValue().getFieldValue("componentName")).isEqualTo(file.longName()); + } + + @Test + public void send_issues_change_notification_on_branch() throws Exception { + ComponentDto project = newPrivateProjectDto(newOrganizationDto()); + ComponentDto branch = newProjectBranch(project, newBranchDto(project).setKey(BRANCH_NAME)); + ComponentDto file = newFileDto(branch); + treeRootHolder.setRoot(builder(Type.PROJECT, 2).setKey(branch.getDbKey()).setPublicKey(branch.getKey()).setName(branch.longName()).setUuid(branch.uuid()).addChildren( + builder(Component.Type.FILE, 11).setKey(file.getDbKey()).setPublicKey(file.getKey()).setName(file.longName()).build() + ).build()); + RuleDefinitionDto ruleDefinitionDto = newRule(); + DefaultIssue issue = newIssue(ruleDefinitionDto, branch, file).toDefaultIssue() + .setNew(false) + .setChanged(true) + .setSendNotifications(true); + ruleRepository.add(ruleDefinitionDto.getKey()).setName(ruleDefinitionDto.getName()); + issueCache.newAppender().append(issue).close(); + when(notificationService.hasProjectSubscribersForTypes(branch.uuid(), SendIssueNotificationsStep.NOTIF_TYPES)).thenReturn(true); + analysisMetadataHolder.setBranch(newBranch()); underTest.execute(); - verify(notificationService).deliver(any(IssueChangeNotification.class)); + ArgumentCaptor issueChangeNotificationCaptor = ArgumentCaptor.forClass(IssueChangeNotification.class); + verify(notificationService).deliver(issueChangeNotificationCaptor.capture()); + assertThat(issueChangeNotificationCaptor.getValue().getFieldValue("projectName")).isEqualTo(branch.longName()); + assertThat(issueChangeNotificationCaptor.getValue().getFieldValue("projectKey")).isEqualTo(branch.getKey()); + assertThat(issueChangeNotificationCaptor.getValue().getFieldValue("branch")).isEqualTo(BRANCH_NAME); + assertThat(issueChangeNotificationCaptor.getValue().getFieldValue("componentKey")).isEqualTo(file.getKey()); + assertThat(issueChangeNotificationCaptor.getValue().getFieldValue("componentName")).isEqualTo(file.longName()); } private NewIssuesNotification createNewIssuesNotificationMock() { @@ -202,6 +251,13 @@ public class SendIssueNotificationsStepTest extends BaseStepTest { return notification; } + private static Branch newBranch() { + Branch branch = mock(Branch.class); + when(branch.isMain()).thenReturn(false); + when(branch.getName()).thenReturn(BRANCH_NAME); + return branch; + } + @Override protected ComputationStep step() { return underTest; diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/notification/IssueChangeNotificationTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/notification/IssueChangeNotificationTest.java index 0ce96f6ba88..18a513ca9ff 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/notification/IssueChangeNotificationTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/notification/IssueChangeNotificationTest.java @@ -44,7 +44,6 @@ public class IssueChangeNotificationTest { assertThat(result.getFieldValue("key")).isEqualTo("ABCD"); assertThat(result.getFieldValue("assignee")).isEqualTo("simon"); assertThat(result.getFieldValue("message")).isEqualTo("Remove this useless method"); - assertThat(result.getFieldValue("componentKey")).isEqualTo("MyService"); assertThat(result.getFieldValue("old.resolution")).isEqualTo("FALSE-POSITIVE"); assertThat(result.getFieldValue("new.resolution")).isEqualTo("FIXED"); } -- 2.39.5