Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@TestHTTPEndpoint misconfigures Rest Assured in case of regex in @Path #23084

Closed
pschyma opened this issue Jan 21, 2022 · 0 comments · Fixed by #23095
Closed

@TestHTTPEndpoint misconfigures Rest Assured in case of regex in @Path #23084

pschyma opened this issue Jan 21, 2022 · 0 comments · Fixed by #23095
Labels
kind/bug Something isn't working
Milestone

Comments

@pschyma
Copy link

pschyma commented Jan 21, 2022

Describe the bug

Having a resource annotated with e.g. @Path("/report/{month : \\d{4}-\\d{2}}) configures Rest Assured to expect a path parameter named "month : \d{4". (Basically Quarkus injects the whole path, but RA does not support regex here.)

Expected behavior

Quarkus strips the regex from the injected URL, so only "/report/{month}" is injected into RA.

Actual behavior

Quarkus injects the raw path definition and breaks RA. Using pathParam("{month}", "2022-01") yields an exception about redundant ("month") and missing ("month : \d{4, 2") parameters.

How to Reproduce?

  1. Create simple resource annotated with a regex @path
  2. Use @TestHTTPEndpoint to configure RA in the test
  3. Try to set the path parameter and run the test

Output of uname -a or ver

Linux enterprise 5.16.2-arch1-1 #1 SMP PREEMPT Thu, 20 Jan 2022 16:18:29 +0000 x86_64 GNU/Linux

Output of java -version

openjdk version "11.0.13" 2021-10-19 OpenJDK Runtime Environment Temurin-11.0.13+8 (build 11.0.13+8) OpenJDK 64-Bit Server VM Temurin-11.0.13+8 (build 11.0.13+8, mixed mode)

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.6.2.Final

Build tool (ie. output of mvnw --version or gradlew --version)

Gradle 7.3.3

Additional information

No response

@pschyma pschyma added the kind/bug Something isn't working label Jan 21, 2022
geoand added a commit to geoand/quarkus that referenced this issue Jan 21, 2022
geoand added a commit that referenced this issue Jan 21, 2022
Make @TestHTTPEndpoint work with path variables
@quarkus-bot quarkus-bot bot added this to the 2.8 - main milestone Jan 21, 2022
@gsmet gsmet modified the milestones: 2.8 - main, 2.7.0.Final Jan 25, 2022
gsmet pushed a commit to gsmet/quarkus that referenced this issue Jan 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants