Commit b84171cf authored by 吕雯燕's avatar 吕雯燕

Merge branch 'master' of gitlab2.dui88.com:mabo/test-platform

parents 9cb7ba63 d4fdd551
...@@ -167,6 +167,7 @@ public class 积分夺宝开奖_AccessTest extends DuibaTestBase { ...@@ -167,6 +167,7 @@ public class 积分夺宝开奖_AccessTest extends DuibaTestBase {
String prizeDetailUrl = String.valueOf(rewardResponse.jsonPath().getString("data.prizeDetailUrl")); String prizeDetailUrl = String.valueOf(rewardResponse.jsonPath().getString("data.prizeDetailUrl"));
//夺宝详情页面 //夺宝详情页面
Thread.sleep(5000);
Response detailResponse = happyCodeNewService.detail(uid,activityId,basicId,phaseId); Response detailResponse = happyCodeNewService.detail(uid,activityId,basicId,phaseId);
detailResponse.prettyPrint(); detailResponse.prettyPrint();
String prizeType = String.valueOf(detailResponse.jsonPath().getString("data.prizeType")); String prizeType = String.valueOf(detailResponse.jsonPath().getString("data.prizeType"));
......
package http.service.Activity;
import http.service.Authorization;
import io.restassured.http.Cookies;
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 equityPrizeService {
@Value("${activity.host}")
String activityHost;
@Autowired
Authorization authorization;
/**
* 核销一期 /aaw/equityPrize/exchange
* Request Method: POST
*
* @param excCode 兑换码
* @return
* @throws Exception
*/
public Response exchange(Map cookies, String excCode, String validate) throws Exception {
Map<String, String> map = new HashMap<>();
map.put("excCode", excCode);
map.put("validate", validate);
Response response = given().cookies(cookies).params(map).post(activityHost + "/aaw/equityPrize/exchange");
try {
// Assert.assertEquals(response.jsonPath().getString("success"), "true", "/aaw/equityPrize/exchange接口失败");
Assert.assertEquals(String.valueOf(response.getStatusCode()), "200", "/aaw/equityPrize/exchange接口失败");
} catch (Exception e) {
throw new Exception("/aaw/equityPrize/exchange接口失败,返回信息:" + response.asString());
} catch (Error er) {
throw new Exception("/aaw/equityPrize/exchange接口失败,返回信息:" + response.asString());
}
return response;
}
}
\ No newline at end of file
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