0
    @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");
    }
4

1 回答 1

0

没有办法删除配置RequestSpecification--> 不应该重用它。您必须为每个请求创建此类的新实例。

类似情况:https ://stackoverflow.com/a/69569031/7574461

于 2022-01-23T02:30:47.770 回答