refactor(消息通知): 统一发送邮件时的标题为中文

This commit is contained in:
CaptainB 2022-10-11 14:18:53 +08:00 committed by 刘瑞斌
parent 08c07dec13
commit de939eb79f
3 changed files with 6 additions and 6 deletions

View File

@ -217,10 +217,10 @@ public class TestResultService {
String failedContext = "${operator}执行接口自动化失败: ${name}" + ", 报告: ${reportUrl}";
if (StringUtils.equals(ReportTriggerMode.API.name(), report.getTriggerMode())) {
subject = Translator.get("task_notification_jenkins");
subject = "Jenkins任务通知";
}
if (StringUtils.equals(ReportTriggerMode.SCHEDULE.name(), report.getTriggerMode())) {
subject = Translator.get("task_notification");
subject = "任务通知";
}
if (StringUtils.equalsIgnoreCase(ApiReportStatus.SUCCESS.name(), report.getStatus())) {
event = NoticeConstants.Event.EXECUTE_SUCCESSFUL;

View File

@ -47,10 +47,10 @@ public class PerformanceNoticeEvent implements LoadTestFinishEvent {
String successContext = "${operator}执行性能测试成功: ${name}, 报告: ${reportUrl}";
String failedContext = "${operator}执行性能测试失败: ${name}, 报告: ${reportUrl}";
if (StringUtils.equals(ReportTriggerMode.API.name(), loadTestReport.getTriggerMode())) {
subject = Translator.get("task_notification_jenkins");
subject = "Jenkins任务通知";
}
if (StringUtils.equals(ReportTriggerMode.SCHEDULE.name(), loadTestReport.getTriggerMode())) {
subject = Translator.get("task_notification");
subject = "任务通知";
}
if (PerformanceTestStatus.Completed.name().equals(loadTestReport.getStatus())) {

View File

@ -128,9 +128,9 @@ public class TestPlanMessageService {
String failedContext = "${operator}执行的 ${name} 测试计划运行失败, 报告: ${planShareUrl}";
String context = "${operator}完成了测试计划: ${name}, 报告: ${planShareUrl}";
if (StringUtils.equals(testPlanReport.getTriggerMode(), ReportTriggerMode.API.name())) {
subject = Translator.get("task_notification_jenkins");
subject = "Jenkins任务通知";
} else {
subject = Translator.get("task_notification");
subject = "任务通知";
}
// 计算通过率
TestPlanDTOWithMetric testPlanDTOWithMetric = BeanUtils.copyBean(new TestPlanDTOWithMetric(), testPlan);