@Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException,
            IOException {
        builder.append("GET:").append(req.getRequestURI()).append("\n"); //$NON-NLS-1$ //$NON-NLS-2$
        payloads.add(null);
        if (req.getRequestURI().contains("/system/status")) { //$NON-NLS-1$
            resp.setStatus(200);
            resp.setContentType("application/json"); //$NON-NLS-1$
            PrintWriter printWriter = new PrintWriter(resp.getOutputStream());
            printWriter.println("{ \"up\" : true, \"version\" : \"1.0.Mock\", \"id\" : \"apiman-gateway-api\", \"name\" : \"API Gateway REST API\", \"description\" : \"\" }"); //$NON-NLS-1$
            printWriter.flush();
            printWriter.close();
        } else if (req.getRequestURI().contains("/apis") && req.getRequestURI().endsWith("/endpoint")) { //$NON-NLS-1$ //$NON-NLS-2$
            resp.setStatus(200);
            resp.setContentType("application/json"); //$NON-NLS-1$
            PrintWriter printWriter = new PrintWriter(resp.getOutputStream());
            printWriter.println("{ \"endpoint\" : \"http://example.org/endpoint\" }"); //$NON-NLS-1$
            printWriter.flush();
            printWriter.close();
        } else if (req.getRequestURI().contains("system/endpoint")) { //$NON-NLS-1$
            resp.setStatus(200);
            resp.setContentType("application/json"); //$NON-NLS-1$
            PrintWriter printWriter = new PrintWriter(resp.getOutputStream());
            printWriter.println("{ \"endpoint\" : \"" + System.getProperty("apiman.test.gateway.endpoint") + "\" }"); //$NON-NLS-1$
            printWriter.flush();
            printWriter.close();
        } else {
            resp.setStatus(204);
        }
    }
@see javax.servlet.http.HttpServlet#doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
manager/test/api/src/main/java/io/apiman/manager/test/server/MockGatewayServlet.java