Commit 8f47fb4a authored by panyuli's avatar panyuli

zr

parents 663e8c3e 828c52e4
...@@ -23,7 +23,8 @@ import static io.restassured.RestAssured.given; ...@@ -23,7 +23,8 @@ import static io.restassured.RestAssured.given;
* Created by panyuli on 2018/07/06. * Created by panyuli on 2018/07/06.
*/ */
public class 优惠券_兑换流程测试pyl_ExchangeTest extends CheckTemplet { public class 优惠券_兑换异常测试_ExchangeTest extends CheckTemplet {
@Autowired @Autowired
private MobileService mobileService; private MobileService mobileService;
......
...@@ -42,4 +42,28 @@ public class VirtualExchangeService { ...@@ -42,4 +42,28 @@ public class VirtualExchangeService {
return response; return response;
} }
public Response exchange2(Map cookies, String appItemId,String degreeId) throws Exception {
Map<String,String> map = new HashMap<>();
map.put("appItemId",appItemId);
map.put("degreeId",degreeId);
map.put("token","xz9eyi");
logger.info("请求/virtualExchange/exchange接口");
Response response = given().contentType("application/x-www-form-urlencoded;charset=UTF-8").cookies(cookies).params(map).post("http://"+goodsHost+"/virtualExchange/exchange");//couponExchange
try{
Assert.assertEquals(String.valueOf(response.getStatusCode()), "200", "/objectExchange/exchange接口返回异常");
}catch(Exception e){
throw new Exception("/objectExchange/exchange接口返回异常,返回信息:"+response.asString());
}catch(Error er){
throw new Exception("/objectExchange/exchange接口返回异常,返回信息:"+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