Commit 67b2c280 by Li Yongyu

支持单独定义请求

parent 4d9f16ab
......@@ -6,7 +6,7 @@
<classes>
<class name="com.puhui.test.RenMai_APITest">
<methods>
<include name="f" invocation-numbers=""/>
<include name="f" invocation-numbers="1 2 "/>
</methods>
</class>
</classes>
......
......@@ -35,6 +35,7 @@ public class RequestDataUtils {
ra.config = RestAssuredConfig.newConfig().sslConfig(
SSLConfig.sslConfig().allowAllHostnames());
// System.out.println(""+tem.getRM_URI()+"");
if(tem!=null){
ra.baseURI = tem.getRM_URI();
// System.out.println(tem.getRM_port());
......@@ -46,6 +47,7 @@ public class RequestDataUtils {
if (tem.getRM_basePath()!=null && tem.getRM_basePath().length()>1){
ra.basePath = tem.getRM_basePath();
}
}
// RestAssured.config = RestAssured.config().encoderConfig(EncoderConfig.encoderConfig().encodeContentTypeAs("x-www-form-urlencoded", ContentType.ANY).defaultContentCharset("utf-8"));
return ra;
}
......@@ -122,7 +124,7 @@ public class RequestDataUtils {
String system= MapUtil.getValue("system", data);
com.offcn.system.system tem=(com.offcn.system.system)(BasicsGM.map.get(system));
String path=tem.getRM_URI()+tem.getRM_port()+tem.getRM_basePath()+myRequest.getUrl();
System.out.println("path====" + path);
parameter=parameter.substring(1, parameter.length()-1);
Log.logInfo(data.get("Description").toString()+","+data.get("TCNO").toString()+","+path+",Parameter="+parameter);
// 设置参数格式
......@@ -164,6 +166,10 @@ public class RequestDataUtils {
String system = MapUtil.getValue("system", data);
com.offcn.system.system tem = (com.offcn.system.system) (BasicsGM.map.get(system));
String path=tem.getRM_URI()+tem.getRM_port()+tem.getRM_basePath()+myRequest.getUrl();
if(myRequest.getUrl().contains("http://")){
tem=null;
path=myRequest.getUrl();
}
Log.logInfo(data.get("Description").toString() + "," + data.get("TCNO").toString() +","+path+ ",Parameter=" + Parameter);
int state = 0;
......
......@@ -88,13 +88,16 @@ public class moment extends STUDY implements API {
//Map<String,String> cookies=new HashMap<String,String>();
//cookies.put("PHPSESSID", PHPSESSID);
Map<String,String> token=new HashMap<String,String>();
token.put("Authorization", "token");
/*Map<String,String> token=new HashMap<String,String>();
token.put("Authorization", "token");*/
Map<String,String> ticket=new HashMap<String,String>();
ticket.put("offcn-ticket", Ticket);
MyRequest myRequest=new MyRequest();
myRequest.setParameter(parameter);
myRequest.setUrl(Url);
System.out.println("Url====" +Url);
myRequest.setRequest(Request);
myRequest.setHeaders(ticket);
//myRequest.setCookies(cookies);
Response re = RequestDataUtils.RestAssuredApi(data, myRequest);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment