【发布时间】:2021-04-05 07:09:58
【问题描述】:
我已经在拦截器中设置了内容类型,但是在运行 API 时,没有调用拦截器。
package com.gdn.qa.module.athens.api.interceptors;
import com.gdn.qa.automation.core.restassured.ServiceInterceptor;
import io.restassured.specification.RequestSpecification;
import static io.restassured.RestAssured.given;
public class AthensIAGInterceptor implements ServiceInterceptor {
@Override
public boolean isSupport(String serviceName) {
if (serviceName.equalsIgnoreCase("athens_iag")) {
return true;
}
return false;
}
enter code here
@Override
public void prepare(RequestSpecification resp1) {
resp1 = given().log().all().contentType("application/json");
}
}
如果我缺少任何步骤,请帮助我。
【问题讨论】:
-
Logging Rest Assured's own headers 我认为此链接是您正在寻找的答案。看看吧。
标签: java rest-assured