Introduce query methods to DSL#1312
Conversation
|
cc: @domhanak |
There was a problem hiding this comment.
Pull request overview
This PR expands the fluent HTTP DSL to support specifying query parameters via additional query(...) overloads and ensures repeated query configuration accumulates (merges) rather than overwrites, with added test coverage validating the new behaviors.
Changes:
- Added
query(...)overloads toBaseCallHttpSpecfor expression, map, and single key/value usage. - Updated
CallHttpTaskFluentquery handling to merge new HTTP query params with any existing ones. - Added functional tests exercising query parameter construction/merging and updated an existing builder test.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| fluent/spec/src/test/java/io/serverlessworkflow/fluent/spec/WorkflowBuilderTest.java | Adds an assertion covering the new query(String, String) overload in the spec DSL tests. |
| fluent/spec/src/main/java/io/serverlessworkflow/fluent/spec/spi/CallHttpTaskFluent.java | Implements query parameter merging by seeding builders from any existing HTTP query params. |
| fluent/spec/src/main/java/io/serverlessworkflow/fluent/spec/dsl/BaseCallHttpSpec.java | Introduces new fluent query(...) overloads in the DSL surface. |
| experimental/test/src/test/java/io/serverlessworkflow/fluent/test/FuncHttpTest.java | New functional tests validating query behavior against a mock HTTP server. |
| experimental/test/pom.xml | Adds test dependencies needed for functional HTTP/query tests (MockWebServer, impl-http, Jersey, etc.). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
experimental/test/src/test/java/io/serverlessworkflow/fluent/test/FuncHttpTest.java
Outdated
Show resolved
Hide resolved
experimental/test/src/test/java/io/serverlessworkflow/fluent/test/FuncHttpTest.java
Outdated
Show resolved
Hide resolved
experimental/test/src/test/java/io/serverlessworkflow/fluent/test/FuncHttpTest.java
Outdated
Show resolved
Hide resolved
experimental/test/src/test/java/io/serverlessworkflow/fluent/test/FuncHttpTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
experimental/test/src/test/java/io/serverlessworkflow/fluent/test/FuncHttpTest.java
Show resolved
Hide resolved
experimental/test/src/test/java/io/serverlessworkflow/fluent/test/FuncHttpTest.java
Outdated
Show resolved
Hide resolved
experimental/test/src/test/java/io/serverlessworkflow/fluent/test/FuncHttpTest.java
Outdated
Show resolved
Hide resolved
fjtirado
left a comment
There was a problem hiding this comment.
Some comments needs adressing, specially the one for the pom
Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fluent/spec/src/test/java/io/serverlessworkflow/fluent/spec/WorkflowBuilderTest.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com>
Changes
This pull request introduces enhanced support for HTTP query parameters in the fluent API, allowing for more flexible and expressive ways to define queries in workflow tasks. It adds new overloads for the
querymethod, improves query parameter merging, and includes comprehensive test coverage for these scenarios.Fluent API Enhancements:
querymethod inBaseCallHttpSpec, allowing users to specify query parameters as a single string, a map, or a key-value pair. This makes it easier to construct HTTP queries in different formats.querymethod inCallHttpTaskFluentto merge new query parameters with existing ones, ensuring that multiple calls toqueryaccumulate parameters rather than overwrite them.Testing Improvements:
FuncHttpTest.java, that covers various scenarios for using thequerymethod, including single and multiple parameters, maps, expressions, empty maps, special characters, and combinations with headers.WorkflowBuilderTestto include a test for the newquery(String, String)overload, verifying that single key-value queries are correctly handled.Closes #1301