[Fix #1280] Support both casting to JsonNode and Collection#1281
[Fix #1280] Support both casting to JsonNode and Collection#1281fjtirado merged 1 commit intoserverlessworkflow:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds support for treating WorkflowModelCollection results as either a Jackson ArrayNode/JsonNode or as a Java Collection, enabling outputAs(...) lambdas to accept either shape when using listen(..., toOne(...)).
Changes:
- Extend
JacksonModelCollection.as(Class<T>)to returnthiswhenCollection.classis requested. - Add a new
experimental/testMaven module with a runtime-style test coveringoutputAswithCollectionand withArrayNode. - Register the new test module in
experimental/pom.xml.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
impl/model/src/main/java/io/serverlessworkflow/impl/model/jackson/JacksonModelCollection.java |
Enables as(Collection.class) casting for model collections. |
experimental/test/src/test/java/io/serverlessworkflow/fluent/test/Review.java |
Test record used as emitted/consumed payload. |
experimental/test/src/test/java/io/serverlessworkflow/fluent/test/FuncEventFilterTest.java |
New test exercising outputAs with Collection and ArrayNode for listen(...toOne...). |
experimental/test/pom.xml |
New Maven module descriptor for the experimental tests. |
experimental/pom.xml |
Adds the new test module to the experimental reactor build. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
experimental/test/src/test/java/io/serverlessworkflow/fluent/test/FuncEventFilterTest.java
Outdated
Show resolved
Hide resolved
experimental/test/src/test/java/io/serverlessworkflow/fluent/test/FuncEventFilterTest.java
Outdated
Show resolved
Hide resolved
experimental/test/src/test/java/io/serverlessworkflow/fluent/test/FuncEventFilterTest.java
Outdated
Show resolved
Hide resolved
…llection Signed-off-by: fjtirado <ftirados@redhat.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 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <dependency> | ||
| <groupId>org.mockito</groupId> | ||
| <artifactId>mockito-core</artifactId> | ||
| <scope>test</scope> | ||
| </dependency> |
There was a problem hiding this comment.
mockito-core is declared as a test dependency here but isn't used by any tests in this module, which adds unnecessary dependency weight and can slow down builds. Please remove it (or add a test that actually needs it).
| <dependency> | |
| <groupId>org.mockito</groupId> | |
| <artifactId>mockito-core</artifactId> | |
| <scope>test</scope> | |
| </dependency> |
Fix #1280