Commit 35c82808 authored by 吕雯燕's avatar 吕雯燕

lv

parent 76a68286
package http.service.app;
import http.service.Authorization;
import io.restassured.response.Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.testng.Assert;
import java.util.HashMap;
import java.util.Map;
import static io.restassured.RestAssured.given;
@Service
public class tawService {
@Value("${trade.host}")
private String tradeHost;
@Autowired
Authorization authorization;
//订单结果页
public Response detailItems(String orderId,int uid) throws Exception{
Map<String,String> map = new HashMap<>();
map.put("orderId",orderId);
Response response = given().cookies(authorization.dafuwengLogin(uid)).params(map).get("http://"+tradeHost+"/taw/h5/detailItems");
try{
Assert.assertEquals(response.jsonPath().getString("success"),"true","/taw/h5/detailItems接口失败");
}catch(Exception e){
throw new Exception("/taw/h5/detailItemse接口失败,返回信息:"+response.asString());
}catch(Error er){
throw new Exception("/taw/h5/detailItems接口失败,返回信息:"+response.asString());
}
return response;
}
}
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