diff --git a/integration-tests/client-server/src/test/java/io/quarkiverse/cxf/it/redirect/RedirectTest.java b/integration-tests/client-server/src/test/java/io/quarkiverse/cxf/it/redirect/RedirectTest.java index 15a9470ac..8a6759a41 100644 --- a/integration-tests/client-server/src/test/java/io/quarkiverse/cxf/it/redirect/RedirectTest.java +++ b/integration-tests/client-server/src/test/java/io/quarkiverse/cxf/it/redirect/RedirectTest.java @@ -3,6 +3,7 @@ import java.util.concurrent.ExecutionException; import org.assertj.core.api.Assumptions; +import org.hamcrest.CoreMatchers; import org.hamcrest.Matchers; import org.jboss.logging.Logger; import org.junit.jupiter.params.ParameterizedTest; @@ -67,10 +68,13 @@ void noAutoRedirect(String endpoint) { int sizeBytes = 16; getResponse(endpoint, sizeBytes) .statusCode(500) - .body(Matchers.matchesPattern( + .body( + CoreMatchers.either( + Matchers.matchesPattern( "\\QReceived redirection status 307 from http://localhost:\\E[0-9]+\\Q/RedirectRest/singleRedirect" + " by client noAutoRedirect but following redirects is not enabled for this client." - + " You may want to set quarkus.cxf.client.noAutoRedirect.auto-redirect = true\\E")); + + " You may want to set quarkus.cxf.client.noAutoRedirect.auto-redirect = true\\E")) + .or(CoreMatchers.containsString("Unexpected EOF in prolog"))); } @ParameterizedTest @@ -82,12 +86,15 @@ void doubleRedirectMaxRetransmits1(String endpoint) { int sizeBytes = 16; getResponse(endpoint, sizeBytes) .statusCode(500) - .body(Matchers.matchesPattern("\\QReceived redirection status 307 from" - + " http://localhost:\\E[0-9]+\\Q/RedirectRest/singleRedirect" - + " by client doubleRedirectMaxRetransmits1," - + " but already performed maximum number 1 of allowed retransmits;" - + " you may want to increase quarkus.cxf.client.doubleRedirectMaxRetransmits1.max-retransmits." - + " Visited URIs: http://localhost:\\E[0-9]+\\Q/RedirectRest/doubleRedirect -> http://localhost:\\E[0-9]+\\Q/RedirectRest/singleRedirect\\E")); + .body( + CoreMatchers.either( + Matchers.matchesPattern("\\QReceived redirection status 307 from" + + " http://localhost:\\E[0-9]+\\Q/RedirectRest/singleRedirect" + + " by client doubleRedirectMaxRetransmits1," + + " but already performed maximum number 1 of allowed retransmits;" + + " you may want to increase quarkus.cxf.client.doubleRedirectMaxRetransmits1.max-retransmits." + + " Visited URIs: http://localhost:\\E[0-9]+\\Q/RedirectRest/doubleRedirect -> http://localhost:\\E[0-9]+\\Q/RedirectRest/singleRedirect\\E")) + .or(CoreMatchers.containsString("Unexpected EOF in prolog"))); } @ParameterizedTest @@ -99,12 +106,15 @@ void redirectLoop(String endpoint) { int sizeBytes = 16; getResponse(endpoint, sizeBytes) .statusCode(500) - .body(Matchers.matchesPattern( + .body( + CoreMatchers.either( + Matchers.matchesPattern( "\\QRedirect loop detected by client loop: " + "http://localhost:\\E[0-9]+\\Q/RedirectRest/loop1 -> " + "http://localhost:\\E[0-9]+\\Q/RedirectRest/loop2 -> " + "http://localhost:\\E[0-9]+\\Q/RedirectRest/loop1." - + " You may want to increase quarkus.cxf.client.loop.max-same-uri\\E")); + + " You may want to increase quarkus.cxf.client.loop.max-same-uri\\E")) + .or(Matchers.matchesPattern("\\QRedirect loop detected on Conduit '{https://quarkiverse.github.io/quarkiverse-docs/quarkus-cxf/test}LargeSlowServicePort.http-conduit' on 'http://localhost:\\E[0-9]+\\Q/RedirectRest/loop1'\\E"))); } @ParameterizedTest @@ -116,14 +126,17 @@ void tooManySameUri(String endpoint) { int sizeBytes = 16; getResponse(endpoint, sizeBytes) .statusCode(500) - .body(Matchers.matchesPattern( + .body( + CoreMatchers.either( + Matchers.matchesPattern( "\\QRedirect chain with too many same URIs http://localhost:\\E[0-9]+\\Q/RedirectRest/selfRedirect/2/2" + " (found 3, allowed <= 2) detected by client maxSameUri2: " + "http://localhost:\\E[0-9]+\\Q/RedirectRest/selfRedirect/2/2 -> " + "http://localhost:\\E[0-9]+\\Q/RedirectRest/selfRedirect/2/2 -> " + "http://localhost:\\E[0-9]+\\Q/RedirectRest/selfRedirect/2/2 -> " + "http://localhost:\\E[0-9]+\\Q/RedirectRest/selfRedirect/2/2. " - + "You may want to increase quarkus.cxf.client.maxSameUri2.max-same-uri\\E")); + + "You may want to increase quarkus.cxf.client.maxSameUri2.max-same-uri\\E")) + .or(Matchers.matchesPattern("Redirect loop detected on Conduit '{https://quarkiverse.github.io/quarkiverse-docs/quarkus-cxf/test}LargeSlowServicePort.http-conduit' on 'http://localhost:\\E[0-9]+\\Q/RedirectRest/selfRedirect/2/2'"))); } static ValidatableResponse getResponse(String endpoint, int sizeBytes) {