Authored by xuhui

集成测试-添加运维邮箱

  1 +package com.ui.contants;
  2 +
  3 +/**
  4 + * 名称定死
  5 + * @author hui.xu
  6 + *
  7 + */
  8 +public class AlarmGroupContants {
  9 +
  10 + /**
  11 + * 报警组
  12 + * 运维组
  13 + */
  14 + public final static String GROUP_NAME_YUNWEI = "运维组";
  15 +}
@@ -265,4 +265,6 @@ public class HttpUriContants { @@ -265,4 +265,6 @@ public class HttpUriContants {
265 public static final String GET_ALARMGROUP_ADD_OR_UPDATE = "/alarmGroup/addOrUpdateAlarmGroup"; 265 public static final String GET_ALARMGROUP_ADD_OR_UPDATE = "/alarmGroup/addOrUpdateAlarmGroup";
266 public static final String GET_ALARMGROUP_DELETE_BY_ID = "/alarmGroup/deleteAlarmGroupById"; 266 public static final String GET_ALARMGROUP_DELETE_BY_ID = "/alarmGroup/deleteAlarmGroupById";
267 public static final String GET_ALARMGROUP_GET_ALL = "/alarmGroup/getAllAlarmGroup"; 267 public static final String GET_ALARMGROUP_GET_ALL = "/alarmGroup/getAllAlarmGroup";
268 -} 268 +
  269 + public static final String GET_EMAIL_BY_ALARM_GROUP = "/user/getEmailByAlarmGroup";
  270 +}
@@ -2,6 +2,7 @@ package com.ui.ctrl; @@ -2,6 +2,7 @@ package com.ui.ctrl;
2 2
3 import com.alibaba.fastjson.JSONArray; 3 import com.alibaba.fastjson.JSONArray;
4 import com.alibaba.fastjson.JSONObject; 4 import com.alibaba.fastjson.JSONObject;
  5 +import com.ui.contants.AlarmGroupContants;
5 import com.ui.contants.HttpUriContants; 6 import com.ui.contants.HttpUriContants;
6 import com.ui.http.HttpRestClient; 7 import com.ui.http.HttpRestClient;
7 import com.ui.model.BaseResponse; 8 import com.ui.model.BaseResponse;
@@ -409,6 +410,10 @@ public class ProjectBuildCtrl { @@ -409,6 +410,10 @@ public class ProjectBuildCtrl {
409 public BaseResponse testexecute(String env) { 410 public BaseResponse testexecute(String env) {
410 AutoTestReq autoTestReq = new AutoTestReq(); 411 AutoTestReq autoTestReq = new AutoTestReq();
411 autoTestReq.setEnv(env); 412 autoTestReq.setEnv(env);
  413 + BaseResponse emailResponse = httpRestClient.defaultPost(HttpUriContants.GET_EMAIL_BY_ALARM_GROUP+"?groupName=" + AlarmGroupContants.GROUP_NAME_YUNWEI, null, BaseResponse.class);
  414 + if(emailResponse.getData() != null){
  415 + autoTestReq.setMailto((String)emailResponse.getData());
  416 + }
412 BaseResponse baseResponse = httpRestClient.post("http://qmc.yohops.com:9999/autoTask/executeApiAutoTask", autoTestReq, BaseResponse.class); 417 BaseResponse baseResponse = httpRestClient.post("http://qmc.yohops.com:9999/autoTask/executeApiAutoTask", autoTestReq, BaseResponse.class);
413 return baseResponse; 418 return baseResponse;
414 } 419 }