getmoto / moto

A library that allows you to easily mock out tests based on AWS infrastructure.
http://docs.getmoto.org/en/latest/
Apache License 2.0
7.6k stars 2.03k forks source link

SNS: Support MessageStructure=json for publish and publish_batch #8158

Closed c0va23 closed 1 day ago

c0va23 commented 2 days ago

Hi! I implemented the parameter MessageStructure for SNS's publish and publish_batch methods.

I added unit tests. I tested those changes in the integration tests of my project, which work similarly to the AWS implementation (in my case).

I hope, my changes will be useful to others.

I will be happy to adapt my PR to Moto project standards if needed.

codecov[bot] commented 2 days ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 94.50%. Comparing base (6c68326) to head (9e76e81). Report is 8 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #8158 +/- ## ======================================= Coverage 94.50% 94.50% ======================================= Files 1150 1150 Lines 99203 99217 +14 ======================================= + Hits 93752 93766 +14 Misses 5451 5451 ``` | [Flag](https://app.codecov.io/gh/getmoto/moto/pull/8158/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=getmoto) | Coverage Δ | | |---|---|---| | [servertests](https://app.codecov.io/gh/getmoto/moto/pull/8158/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=getmoto) | `28.79% <7.14%> (-0.01%)` | :arrow_down: | | [unittests](https://app.codecov.io/gh/getmoto/moto/pull/8158/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=getmoto) | `94.47% <100.00%> (+<0.01%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=getmoto#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.