diff --git a/http/rest-client-reactive/src/main/java/io/quarkus/ts/http/restclient/reactive/proxy/ProxyClient.java b/http/rest-client-reactive/src/main/java/io/quarkus/ts/http/restclient/reactive/proxy/ProxyClient.java index fb9db8265..93c91d983 100644 --- a/http/rest-client-reactive/src/main/java/io/quarkus/ts/http/restclient/reactive/proxy/ProxyClient.java +++ b/http/rest-client-reactive/src/main/java/io/quarkus/ts/http/restclient/reactive/proxy/ProxyClient.java @@ -4,6 +4,7 @@ import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; import org.eclipse.microprofile.rest.client.annotation.RegisterClientHeaders; import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; @@ -22,7 +23,7 @@ public interface ProxyClient { @GET @Path("/example.txt") @Produces(MediaType.TEXT_PLAIN) - Uni getText(); + Uni getText(); @GET @Path("/auth") diff --git a/http/rest-client-reactive/src/main/java/io/quarkus/ts/http/restclient/reactive/proxy/ProxyResource.java b/http/rest-client-reactive/src/main/java/io/quarkus/ts/http/restclient/reactive/proxy/ProxyResource.java index 29214137f..c3785d834 100644 --- a/http/rest-client-reactive/src/main/java/io/quarkus/ts/http/restclient/reactive/proxy/ProxyResource.java +++ b/http/rest-client-reactive/src/main/java/io/quarkus/ts/http/restclient/reactive/proxy/ProxyResource.java @@ -5,6 +5,7 @@ import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; import org.eclipse.microprofile.rest.client.inject.RestClient; @@ -27,7 +28,7 @@ public Uni getRoot() { @GET @Path("/banned") @Produces(MediaType.TEXT_PLAIN) - public Uni getBanned() { + public Uni getBanned() { return client.getText(); } diff --git a/http/rest-client-reactive/src/main/resources/proxy.properties b/http/rest-client-reactive/src/main/resources/proxy.properties index 075eab02d..967cc7213 100644 --- a/http/rest-client-reactive/src/main/resources/proxy.properties +++ b/http/rest-client-reactive/src/main/resources/proxy.properties @@ -3,4 +3,5 @@ quarkus.rest-client."io.quarkus.ts.http.restclient.reactive.proxy.ProxyClient".p quarkus.rest-client."io.quarkus.ts.http.restclient.reactive.proxy.ProxyClient".proxy-user=proxyuser quarkus.rest-client."io.quarkus.ts.http.restclient.reactive.proxy.ProxyClient".proxy-password=proxypassword quarkus.rest-client.logging.scope=request-response -quarkus.log.category."org.jboss.resteasy.reactive.client.logging".level=DEBUG +quarkus.log.category."org.jboss.resteasy.reactive.client.logging".level=INFO +microprofile.rest.client.disable.default.mapper=true diff --git a/http/rest-client-reactive/src/test/java/io/quarkus/ts/http/restclient/reactive/ProxyIT.java b/http/rest-client-reactive/src/test/java/io/quarkus/ts/http/restclient/reactive/ProxyIT.java index b81c55dbb..b88157e48 100644 --- a/http/rest-client-reactive/src/test/java/io/quarkus/ts/http/restclient/reactive/ProxyIT.java +++ b/http/rest-client-reactive/src/test/java/io/quarkus/ts/http/restclient/reactive/ProxyIT.java @@ -39,7 +39,7 @@ void getThrough() { @Test void banned() { Response banned = proxyApp.given().with().get("/proxied/banned"); - Assertions.assertEquals(HttpStatus.SC_OK, banned.statusCode()); + Assertions.assertEquals(HttpStatus.SC_FORBIDDEN, banned.statusCode()); Assertions.assertEquals("Reading is prohibited by corporate policy!", banned.body().asString()); } diff --git a/http/rest-client-reactive/src/test/resources/proxy/Dockerfile b/http/rest-client-reactive/src/test/resources/proxy/Dockerfile index 1cc9e078d..0218c1479 100644 --- a/http/rest-client-reactive/src/test/resources/proxy/Dockerfile +++ b/http/rest-client-reactive/src/test/resources/proxy/Dockerfile @@ -1,2 +1,3 @@ FROM nginx:1.21 +EXPOSE 8090 COPY nginx.conf /etc/nginx/nginx.conf diff --git a/http/rest-client-reactive/src/test/resources/proxy/deploy.sh b/http/rest-client-reactive/src/test/resources/proxy/deploy.sh index cd3749b89..b928c1af8 100755 --- a/http/rest-client-reactive/src/test/resources/proxy/deploy.sh +++ b/http/rest-client-reactive/src/test/resources/proxy/deploy.sh @@ -1,3 +1,6 @@ +VERSION=1.0.1 docker build -t nginx-proxy . docker tag nginx-proxy quay.io/quarkusqeteam/proxy:latest +docker tag nginx-proxy quay.io/quarkusqeteam/proxy:$VERSION docker push quay.io/quarkusqeteam/proxy:latest +docker push quay.io/quarkusqeteam/proxy:$VERSION diff --git a/http/rest-client-reactive/src/test/resources/proxy/nginx.conf b/http/rest-client-reactive/src/test/resources/proxy/nginx.conf index cf7b3ba6c..8002542c4 100644 --- a/http/rest-client-reactive/src/test/resources/proxy/nginx.conf +++ b/http/rest-client-reactive/src/test/resources/proxy/nginx.conf @@ -7,7 +7,7 @@ http { proxy_pass http://$host; } location ~ \.(txt)$ { - return 203 "Reading is prohibited by corporate policy!"; + return 403 "Reading is prohibited by corporate policy!"; } location /auth { return 200 $http_proxy_authorization;