Skip to content

Encode supplied URL path parameters - #203

Merged
en-milie merged 2 commits into
masterfrom
codex/fix-issue-188
Jul 3, 2026
Merged

Encode supplied URL path parameters#203
en-milie merged 2 commits into
masterfrom
codex/fix-issue-188

Conversation

@en-milie

@en-milie en-milie commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Motivation

  • Path parameter values supplied via --urlParams (and ref-data replacements) containing characters like / or & were inserted verbatim into paths causing incorrect requests and mismatches.
  • The change ensures path placeholders are replaced with URL-encoded values so special characters are safely transmitted in paths.

Description

  • Use URLEncoder.encode(..., StandardCharsets.UTF_8) when replacing supplied URL/path params in FilesArguments.replacePathWithUrlParams to encode values before substituting placeholders.
  • Added a unit test shouldUrlEncodeSuppliedUrlParams in FilesArgumentsTest to cover encoding of supplied --urlParams values.
  • Added a parameterized test shouldUrlEncodeRefDataPathParamsForBodyMethods in ServiceCallerTest to assert ref-data path parameters are encoded for body methods (POST, PUT, PATCH).
  • Added the required import java.net.URLEncoder; and updated expectations in tests where appropriate.

Testing

  • Attempted to run mvn -q -Dtest=ServiceCallerTest,FilesArgumentsTest test; automated test execution was blocked because Maven dependency resolution failed with 403 Forbidden from Maven Central for Quarkus/Jackson artifacts, so tests could not complete.
  • The new unit tests were added and committed, but CI/local execution is currently blocked by the repository dependency resolution issue described above.

Codex Task

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 28406818d3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/main/java/com/endava/cats/args/FilesArguments.java Outdated
### Motivation

- Path parameter values supplied via `--urlParams` (and ref-data replacements) containing characters like `/` or `&` were inserted verbatim into paths causing incorrect requests and mismatches.
- The change ensures path placeholders are replaced with URL-encoded values so special characters are safely transmitted in paths.

### Description

- Use `URLEncoder.encode(..., StandardCharsets.UTF_8)` when replacing supplied URL/path params in `FilesArguments.replacePathWithUrlParams` to encode values before substituting placeholders.
- Added a unit test `shouldUrlEncodeSuppliedUrlParams` in `FilesArgumentsTest` to cover encoding of supplied `--urlParams` values.
- Added a parameterized test `shouldUrlEncodeRefDataPathParamsForBodyMethods` in `ServiceCallerTest` to assert ref-data path parameters are encoded for body methods (`POST`, `PUT`, `PATCH`).
- Added the required `import java.net.URLEncoder;` and updated expectations in tests where appropriate.

### Testing

- Attempted to run `mvn -q -Dtest=ServiceCallerTest,FilesArgumentsTest test`; automated test execution was blocked because Maven dependency resolution failed with `403 Forbidden` from Maven Central for Quarkus/Jackson artifacts, so tests could not complete.
- The new unit tests were added and committed, but CI/local execution is currently blocked by the repository dependency resolution issue described above.
@en-milie
en-milie merged commit bd6df95 into master Jul 3, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant