I'm using REST-Assured library with TestNG for receiving the response in a Response
object as below.
Response response;
@Test
public void someTest() {
RestAssured.baseURI = "some_valid_baseURI";
RestAssured.basePath = "some_valid_endpoint";
response = RestAssured.given().contentType(ContentType.JSON).when().get();
}
I have several test methods like the above-mentioned method in a test class. Is there any way to intercept the response assignment so that I can, somewhere else (e.g. in a method annotated by an @AfterMethod
), know that the method being used to get the response is the GET
method?
PS: I did not find any in-built way in the REST-Assured library to do this.