Repository: getmoto/moto
Pull request #6876 (2023-10-01 22:52:16)

Bump software.amazon.awssdk:bom from 2.20.139 to 2.20.157 in /other_langs/tests_java
Bumps software.amazon.awssdk:bom from 2.20.139 to 2.20.157.


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=software.amazon.awssdk:bom&package-manager=maven&previous-version=2.20.139&new-version=2.20.157)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>

codecov[bot]: ## [Codecov](https://app.codecov.io/gh/getmoto/moto/pull/6876?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=getmoto) Report
> Merging [#6876](https://app.codecov.io/gh/getmoto/moto/pull/6876?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=getmoto) (0aa1826) into [master](https://app.codecov.io/gh/getmoto/moto/commit/9767f0226d2c87afc52beacfe417ff2f20843cf4?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=getmoto) (9767f02) will **not change** coverage.
> The diff coverage is `n/a`.

```diff
@@           Coverage Diff           @@
##           master    #6876   +/-   ##
=======================================
  Coverage   95.81%   95.81%           
=======================================
  Files         821      821           
  Lines       80624    80624           
=======================================
  Hits        77249    77249           
  Misses       3375     3375           
```

| [Flag](https://app.codecov.io/gh/getmoto/moto/pull/6876/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/6876/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=getmoto) | `36.83% <ø> (ø)` | |
| [unittests](https://app.codecov.io/gh/getmoto/moto/pull/6876/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=getmoto) | `95.75% <ø> (+<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.




Patch:
diff --git a/moto/events/models.py b/moto/events/models.py
index 5ec5a318c..d8d0cc229 100644
--- a/moto/events/models.py
+++ b/moto/events/models.py
@@ -1327,7 +1327,11 @@ class EventsBackend(BaseBackend):
                 )
             else:
                 try:
-                    json.loads(event["Detail"])
+                    detail = json.loads(event["Detail"])
+                    if not isinstance(detail, dict):
+                        warnings.warn(
+                            f"EventDetail should be of type dict - types such as {type(detail)} are ignored by AWS"
+                        )
                 except ValueError:  # json.JSONDecodeError exists since Python 3.5
                     entries.append(
                         {


Test patch:
diff --git a/other_langs/tests_java/pom.xml b/other_langs/tests_java/pom.xml
index 560a3a917..6f94fd721 100644
--- a/other_langs/tests_java/pom.xml
+++ b/other_langs/tests_java/pom.xml
@@ -22,7 +22,7 @@
     <dependency>
       <groupId>software.amazon.awssdk</groupId>
       <artifactId>bom</artifactId>
-      <version>2.20.139</version>
+      <version>2.20.157</version>
       <type>pom</type>
       <scope>import</scope>
     </dependency>
diff --git a/tests/test_events/test_events.py b/tests/test_events/test_events.py
index baf35da3a..0c8f6c667 100644
--- a/tests/test_events/test_events.py
+++ b/tests/test_events/test_events.py
@@ -1,13 +1,14 @@
 import json
 import random
 import unittest
+import warnings
 from datetime import datetime, timezone
 
 import boto3
 import pytest
 from botocore.exceptions import ClientError
 
-from moto import mock_logs
+from moto import mock_logs, settings
 from moto.core import DEFAULT_ACCOUNT_ID as ACCOUNT_ID
 from moto.core.utils import iso_8601_datetime_without_milliseconds
 from moto.events import mock_events
@@ -682,6 +683,12 @@ def test_put_events():
     assert response["FailedEntryCount"] == 0
     assert len(response["Entries"]) == 1
 
+    if settings.TEST_DECORATOR_MODE:
+        event["Detail"] = json.dumps([{"Key": "k", "Value": "v"}])
+        with warnings.catch_warnings(record=True) as w:
+            client.put_events(Entries=[event])
+        assert "EventDetail should be of type dict" in str(w[0].message)
+
 
 @mock_events
 def test_put_events_error_too_many_entries():