ProxyResponse extends HttpResponse { @Override public void render(OutputStream stream) throws IOException { stream.write(bodyResponseRewritten.getBytes(StandardCharsets.UTF_8)); } ProxyResponse(
            ProxyRequest controllerRequest,
            String bodyResponse,
            int statusResponse,
            URI configServer,
            String contentType); @Override void render(OutputStream stream); @Override String getContentType();  }
@Test public void testRewriteUrl() throws Exception { ProxyRequest request = new ProxyRequest(HttpRequest.Method.GET, URI.create("http: Map.of(), null, List.of(URI.create("http: ProxyResponse proxyResponse = new ProxyResponse( request, "response link is http: 200, URI.create("http: "application/json"); ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); proxyResponse.render(outputStream); String document = new String(outputStream.toByteArray(), StandardCharsets.UTF_8); assertEquals("response link is http: }
@Test public void testRewriteSecureUrl() throws Exception { ProxyRequest request = new ProxyRequest(HttpRequest.Method.GET, URI.create("https: Map.of(), null, List.of(URI.create("http: ProxyResponse proxyResponse = new ProxyResponse( request, "response link is http: 200, URI.create("http: "application/json"); ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); proxyResponse.render(outputStream); String document = new String(outputStream.toByteArray(), StandardCharsets.UTF_8); assertEquals("response link is https: }