@Test(description = "Verify that user is able to login and get the offer details for a particular promo code", dependsOnGroups = "getAuthKey")
public void verify_offers_with_login_with_promo_code() {
Map<String, String> headers = InputRequestHelper.setHeaders("auth_api_key", auth_api_key);
**// Have to remove the below set path parameters later in the code**
requestSpecification.pathParam("promocode", "1909");
Response response = InputRequestHelper.createGetRequest(requestSpecification, captor,
Constants.OFFER_PROMOCODE_PATH, headers, "com.dhani/schemas/offers/offersPromocode.json");
CommonHelper.writeRequestAndResponseInReport(writer.toString(), response.prettyPrint());
JSONObject jsonObject = new JSONObject(response.getBody().asString());
AssertionHelper.assertNotNull(ParseDynamicJson.getKey(jsonObject, "data"), "data");
AssertionHelper.assertFieldValue(ParseDynamicJson.getKey(jsonObject, "message"), "success", "message");
}
问问题
26 次