@Override
    public Response serve(IHTTPSession session) {
        String r = null;
        val parameterList = session.getParameters().get("r");
        if (parameterList != null && parameterList.size() > 0) {
            r = parameterList.get(0);
        }
        val response = responses.get(r);
        if (response != null) {
            return newFixedLengthResponse(response.getStatus(), response.getMimeType(), response.getBody());
        } else {
            return newFixedLengthResponse(NanoHTTPD.Response.Status.SERVICE_UNAVAILABLE, "plain/text", "no response available");
        }
    }
A web server for tests.

@author Jerome Leleu
@since 2.1.0
pac4j-http/src/test/java/org/pac4j/http/test/tools/WebServer.java