aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-server-common
diff options
context:
space:
mode:
Diffstat (limited to 'server/sonar-server-common')
-rw-r--r--server/sonar-server-common/src/main/java/org/sonar/server/issue/notification/AbstractNewIssuesEmailTemplate.java4
-rw-r--r--server/sonar-server-common/src/main/java/org/sonar/server/issue/notification/NewIssuesNotification.java6
-rw-r--r--server/sonar-server-common/src/main/java/org/sonar/server/notification/email/AlertsEmailTemplate.java2
-rw-r--r--server/sonar-server-common/src/test/java/org/sonar/server/issue/notification/MyNewIssuesEmailTemplateTest.java4
-rw-r--r--server/sonar-server-common/src/test/java/org/sonar/server/issue/notification/NewIssuesEmailTemplateTest.java4
-rw-r--r--server/sonar-server-common/src/test/java/org/sonar/server/issue/notification/NewIssuesNotificationTest.java8
6 files changed, 14 insertions, 14 deletions
diff --git a/server/sonar-server-common/src/main/java/org/sonar/server/issue/notification/AbstractNewIssuesEmailTemplate.java b/server/sonar-server-common/src/main/java/org/sonar/server/issue/notification/AbstractNewIssuesEmailTemplate.java
index cd557d47d64..65580d20ca0 100644
--- a/server/sonar-server-common/src/main/java/org/sonar/server/issue/notification/AbstractNewIssuesEmailTemplate.java
+++ b/server/sonar-server-common/src/main/java/org/sonar/server/issue/notification/AbstractNewIssuesEmailTemplate.java
@@ -51,7 +51,7 @@ public abstract class AbstractNewIssuesEmailTemplate extends EmailTemplate {
static final String FIELD_PROJECT_NAME = "projectName";
static final String FIELD_PROJECT_KEY = "projectKey";
static final String FIELD_PROJECT_DATE = "projectDate";
- static final String FIELD_CODE_PERIOD_VERSION = "codePeriodVersion";
+ static final String FIELD_PROJECT_VERSION = "projectVersion";
static final String FIELD_ASSIGNEE = "assignee";
static final String FIELD_BRANCH = "branch";
static final String FIELD_PULL_REQUEST = "pullRequest";
@@ -89,7 +89,7 @@ public abstract class AbstractNewIssuesEmailTemplate extends EmailTemplate {
if (pullRequest!= null) {
message.append("Pull request: ").append(pullRequest).append(NEW_LINE);
}
- String version = notification.getFieldValue(FIELD_CODE_PERIOD_VERSION);
+ String version = notification.getFieldValue(FIELD_PROJECT_VERSION);
if (version != null) {
message.append("Version: ").append(version).append(NEW_LINE);
}
diff --git a/server/sonar-server-common/src/main/java/org/sonar/server/issue/notification/NewIssuesNotification.java b/server/sonar-server-common/src/main/java/org/sonar/server/issue/notification/NewIssuesNotification.java
index 5cac9b57003..b50ca9ca2a1 100644
--- a/server/sonar-server-common/src/main/java/org/sonar/server/issue/notification/NewIssuesNotification.java
+++ b/server/sonar-server-common/src/main/java/org/sonar/server/issue/notification/NewIssuesNotification.java
@@ -47,7 +47,7 @@ import org.sonar.server.issue.notification.NewIssuesStatistics.Metric;
import static java.util.stream.Collectors.toMap;
import static java.util.stream.Collectors.toSet;
import static org.sonar.server.issue.notification.AbstractNewIssuesEmailTemplate.FIELD_BRANCH;
-import static org.sonar.server.issue.notification.AbstractNewIssuesEmailTemplate.FIELD_CODE_PERIOD_VERSION;
+import static org.sonar.server.issue.notification.AbstractNewIssuesEmailTemplate.FIELD_PROJECT_VERSION;
import static org.sonar.server.issue.notification.AbstractNewIssuesEmailTemplate.FIELD_PULL_REQUEST;
import static org.sonar.server.issue.notification.NewIssuesEmailTemplate.FIELD_PROJECT_DATE;
import static org.sonar.server.issue.notification.NewIssuesEmailTemplate.FIELD_PROJECT_KEY;
@@ -92,9 +92,9 @@ public class NewIssuesNotification extends Notification {
return this;
}
- public NewIssuesNotification setCodePeriodVersion(@Nullable String version) {
+ public NewIssuesNotification setProjectVersion(@Nullable String version) {
if (version != null) {
- setFieldValue(FIELD_CODE_PERIOD_VERSION, version);
+ setFieldValue(FIELD_PROJECT_VERSION, version);
}
return this;
}
diff --git a/server/sonar-server-common/src/main/java/org/sonar/server/notification/email/AlertsEmailTemplate.java b/server/sonar-server-common/src/main/java/org/sonar/server/notification/email/AlertsEmailTemplate.java
index 9c4afbd0e53..519ac52d502 100644
--- a/server/sonar-server-common/src/main/java/org/sonar/server/notification/email/AlertsEmailTemplate.java
+++ b/server/sonar-server-common/src/main/java/org/sonar/server/notification/email/AlertsEmailTemplate.java
@@ -50,7 +50,7 @@ public class AlertsEmailTemplate extends EmailTemplate {
String projectId = notification.getFieldValue("projectId");
String projectKey = notification.getFieldValue("projectKey");
String projectName = notification.getFieldValue("projectName");
- String projectVersion = notification.getFieldValue("codePeriodVersion");
+ String projectVersion = notification.getFieldValue("projectVersion");
String branchName = notification.getFieldValue("branch");
String alertName = notification.getFieldValue("alertName");
String alertText = notification.getFieldValue("alertText");
diff --git a/server/sonar-server-common/src/test/java/org/sonar/server/issue/notification/MyNewIssuesEmailTemplateTest.java b/server/sonar-server-common/src/test/java/org/sonar/server/issue/notification/MyNewIssuesEmailTemplateTest.java
index 3482a1c6497..633799f7c2a 100644
--- a/server/sonar-server-common/src/test/java/org/sonar/server/issue/notification/MyNewIssuesEmailTemplateTest.java
+++ b/server/sonar-server-common/src/test/java/org/sonar/server/issue/notification/MyNewIssuesEmailTemplateTest.java
@@ -120,7 +120,7 @@ public class MyNewIssuesEmailTemplateTest {
@Test
public void format_email_with_no_assignees_tags_nor_components() {
Notification notification = newNotification(32)
- .setFieldValue("codePeriodVersion", "52.0");
+ .setFieldValue("projectVersion", "52.0");
EmailMessage message = underTest.format(notification);
@@ -140,7 +140,7 @@ public class MyNewIssuesEmailTemplateTest {
@Test
public void format_email_with_issue_on_branch() {
Notification notification = newNotification(32)
- .setFieldValue("codePeriodVersion", "52.0")
+ .setFieldValue("projectVersion", "52.0")
.setFieldValue("branch", "feature1");
EmailMessage message = underTest.format(notification);
diff --git a/server/sonar-server-common/src/test/java/org/sonar/server/issue/notification/NewIssuesEmailTemplateTest.java b/server/sonar-server-common/src/test/java/org/sonar/server/issue/notification/NewIssuesEmailTemplateTest.java
index e5f8cf06253..6a78053a360 100644
--- a/server/sonar-server-common/src/test/java/org/sonar/server/issue/notification/NewIssuesEmailTemplateTest.java
+++ b/server/sonar-server-common/src/test/java/org/sonar/server/issue/notification/NewIssuesEmailTemplateTest.java
@@ -88,7 +88,7 @@ public class NewIssuesEmailTemplateTest {
@Test
public void format_email_with_all_fields_filled() {
Notification notification = newNotification(32)
- .setFieldValue("codePeriodVersion", "42.1.1");
+ .setFieldValue("projectVersion", "42.1.1");
addAssignees(notification);
addRules(notification);
addTags(notification);
@@ -179,7 +179,7 @@ public class NewIssuesEmailTemplateTest {
public void format_email_with_issue_on_branch_with_version() {
Notification notification = newNotification(32)
.setFieldValue("branch", "feature1")
- .setFieldValue("codePeriodVersion", "42.1.1");
+ .setFieldValue("projectVersion", "42.1.1");
EmailMessage message = template.format(notification);
diff --git a/server/sonar-server-common/src/test/java/org/sonar/server/issue/notification/NewIssuesNotificationTest.java b/server/sonar-server-common/src/test/java/org/sonar/server/issue/notification/NewIssuesNotificationTest.java
index 660de8f91e7..c7f54833a88 100644
--- a/server/sonar-server-common/src/test/java/org/sonar/server/issue/notification/NewIssuesNotificationTest.java
+++ b/server/sonar-server-common/src/test/java/org/sonar/server/issue/notification/NewIssuesNotificationTest.java
@@ -85,16 +85,16 @@ public class NewIssuesNotificationTest {
public void set_project_version() {
String version = randomAlphanumeric(5);
- underTest.setCodePeriodVersion(version);
+ underTest.setProjectVersion(version);
- assertThat(underTest.getFieldValue(NewIssuesEmailTemplate.FIELD_CODE_PERIOD_VERSION)).isEqualTo(version);
+ assertThat(underTest.getFieldValue(NewIssuesEmailTemplate.FIELD_PROJECT_VERSION)).isEqualTo(version);
}
@Test
public void set_project_version_supports_null() {
- underTest.setCodePeriodVersion(null);
+ underTest.setProjectVersion(null);
- assertThat(underTest.getFieldValue(NewIssuesEmailTemplate.FIELD_CODE_PERIOD_VERSION)).isNull();
+ assertThat(underTest.getFieldValue(NewIssuesEmailTemplate.FIELD_PROJECT_VERSION)).isNull();
}
@Test