Batch SnsNotification is deserialized into incorrect type when using generics #1280
Labels
component: sqs
SQS integration related issue
type: enhancement
Smaller enhancement in existing integration
Type: Bug
Component:
SQS
Describe the bug
While working on a PR for #1272 I noticed batches are not working properly when using
@SnsNotificationMessage
, such as whencreating a listener which takes@SnsNotificationMessage List<MyEnvelope<MyPojo>>
. It actually ends up deserializing into aList<MyEnvelope<LinkedHashMap>>
.Sample
The easiest way to reproduce this is by extending the listener for the existing test for the SNS integration, found here.
By adding an assert for the value contents, the test starts failing:
The following error is output to the terminal:
It appears that even though the parameter of the function is
List<MyEnvelope<MyPojo>>
, the actual cast is not executed until there is an attempt to access the members of the target class, and as the test only checks if the list contains any items, it erroneously passes.The text was updated successfully, but these errors were encountered: