Class Permission implements ContainerRequestContext
{
@context
HttpServletRequest servletRequest;
public void filter(ContainerRequestContext containerRequestContext) throws IOException
{
String Path=servletRequest.getPathInfo();
int id=containerRequestContext.getId();
if(id==null){
containerRequestContext.abortWith(new ServerResponse(ExceptionUtil.getErrorMessageObject(...),errorCode,new Header<Object>()));
}
}
}
How to write the Test for the filter method. I am able to mock the ContainerReqeustContext. But how to mock the HttpServletRequest since it is not the input of the filter()
method.