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

fix: unwrap json on expectType for eventing testkit #1745

Merged
merged 1 commit into from
Jul 26, 2023

Conversation

efgpinto
Copy link
Member

Close #1738

@github-actions github-actions bot added java-sdk-protobuf kalix-runtime Runtime and SDKs sub-team labels Jul 25, 2023
objectMapper.readerFor(clazz).readValue(msg.getMessage.payload.toByteArray)
JsonSupport.getObjectMapper
.readerFor(clazz)
.readValue(msg.getMessage.payload.toByteArray)
Copy link
Member Author

Choose a reason for hiding this comment

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

this is formatting only

@@ -397,6 +398,7 @@ private[testkit] object TestKitMessageImpl {
val bt = BoxedType(clazz)
payload match {
case m if bt.isInstance(m) => m.asInstanceOf[T]
case m: String => JsonSupport.getObjectMapper.readerFor(clazz).readValue(m)
Copy link
Member Author

Choose a reason for hiding this comment

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

this is the fix.. it can only be unwrapped at this point when the class type is known

Copy link
Member

@octonato octonato left a comment

Choose a reason for hiding this comment

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

LGTM

@efgpinto efgpinto merged commit f10e871 into main Jul 26, 2023
65 checks passed
@efgpinto efgpinto deleted the unwrap_json_testkit branch July 26, 2023 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
java-sdk-protobuf kalix-runtime Runtime and SDKs sub-team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Eventing Testkit: expectN not unwrapping json
2 participants