How to get the header which is set in HttpServletResponse object
I am testing the code using TestNG. In the code which I am testing the header is set into HttpServletResponse object for each error/exception occurred. I want to retrieve that response header into my file using which I am testing the code .
Following is the snippet of the code I am testing. the code is written in doFilter method.
if (header == null) {
logger.info("Auth.java filter- Authorization Header is not recieved");httpRes.setStatus(HttpServletResponse.S C_UNAUTHORIZED);
httpRes.setHeader("x-auth-status", "3401b");
return;
}
I want to retrieve the response header in another test file. I cant modify the file which I am testing.
Please reply its urgent.............:frusty: