Repository: getmoto/moto
Pull request #6358 (2023-06-01 22:58:15)

Bump maven-project-info-reports-plugin from 3.4.3 to 3.4.4 in /other_langs/tests_java
Bumps [maven-project-info-reports-plugin](https://github.com/apache/maven-project-info-reports-plugin) from 3.4.3 to 3.4.4.
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/apache/maven-project-info-reports-plugin/commit/c17f87601f70e38876bcbd247e750b2aeb99db18"><code>c17f876</code></a> [maven-release-plugin] prepare release maven-project-info-reports-plugin-3.4.4</li>
<li><a href="https://github.com/apache/maven-project-info-reports-plugin/commit/dbd863fed69f4e86dfddd82e239646a8cf61cf1f"><code>dbd863f</code></a> [MPIR-431] Dependency file details section: segregate Java version column int...</li>
<li><a href="https://github.com/apache/maven-project-info-reports-plugin/commit/2d60f9528559edb0aef7127a97ebdd8ef092291c"><code>2d60f95</code></a> Use proper scope for method</li>
<li><a href="https://github.com/apache/maven-project-info-reports-plugin/commit/f1cccb9445da5fcbb6ccef3f4dc7b6c4649afd0b"><code>f1cccb9</code></a> Fix incorrect ChoiceFormat range</li>
<li><a href="https://github.com/apache/maven-project-info-reports-plugin/commit/0413d65e319a978319d8ef13dc8d2d5411b0c346"><code>0413d65</code></a> Add more scopes to 'full-pom' IT</li>
<li><a href="https://github.com/apache/maven-project-info-reports-plugin/commit/9209a7a175041ba1b2e6902f6f2dbb247a96529d"><code>9209a7a</code></a> [MPIR-437] 'Java version' is set to 0.0 when no JDK details are detected in d...</li>
<li><a href="https://github.com/apache/maven-project-info-reports-plugin/commit/f942ba10c470b014e8a8d1f6c6ff9c385f56018f"><code>f942ba1</code></a> [MPIR-438] Upgrade to maven-shared-jar 3.0.0</li>
<li><a href="https://github.com/apache/maven-project-info-reports-plugin/commit/a5e3348b7c298c7ff50624f6a22ef26668dd645b"><code>a5e3348</code></a> [MPIR-436] Don't use DecimalFormat which is identical with String#valueOf(long)</li>
<li><a href="https://github.com/apache/maven-project-info-reports-plugin/commit/c0316996419929a2a846711f95e532d274103917"><code>c031699</code></a> [MPIR-435] Custom bundle sometimes not loaded due to parent-first class loading</li>
<li><a href="https://github.com/apache/maven-project-info-reports-plugin/commit/3cb4a7392fec8be5cd0f820a4a683c5586715d8c"><code>3cb4a73</code></a> refactor: Replace any StringUtils#isEmpty(String) and #isNotEmpty(String) (<a href="https://redirect.github.com/apache/maven-project-info-reports-plugin/issues/50">#50</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/apache/maven-project-info-reports-plugin/compare/maven-project-info-reports-plugin-3.4.3...maven-project-info-reports-plugin-3.4.4">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=org.apache.maven.plugins:maven-project-info-reports-plugin&package-manager=maven&previous-version=3.4.3&new-version=3.4.4)](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 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/6358?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) Report
> Merging [#6358](https://app.codecov.io/gh/getmoto/moto/pull/6358?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) (df1cc6f) into [master](https://app.codecov.io/gh/getmoto/moto/commit/37cb6cee94ffe294e7d02c7d252bcfb252179177?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) (37cb6ce) will **not change** coverage.
> The diff coverage is `n/a`.

```diff
@@           Coverage Diff           @@
##           master    #6358   +/-   ##
=======================================
  Coverage   96.16%   96.16%           
=======================================
  Files         794      794           
  Lines       77544    77544           
=======================================
  Hits        74570    74570           
  Misses       2974     2974           
```

| Flag | Coverage Δ | |
|---|---|---|
| servertests | `36.89% <ø> (ø)` | |
| unittests | `96.10% <ø> (ø)` | |

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=None#carryforward-flags-in-the-pull-request-comment) to find out more.




Patch:
diff --git a/moto/sns/models.py b/moto/sns/models.py
index a4a0ff719..e252af984 100644
--- a/moto/sns/models.py
+++ b/moto/sns/models.py
@@ -493,7 +493,7 @@ class SNSBackend(BaseBackend):
     def get_topic(self, arn: str) -> Topic:
         parsed_arn = parse_arn(arn)
         try:
-            return sns_backends[parsed_arn.account][parsed_arn.region].topics[arn]
+            return sns_backends[parsed_arn.account][self.region_name].topics[arn]
         except KeyError:
             raise TopicNotFound
 


Test patch:
diff --git a/other_langs/tests_java/pom.xml b/other_langs/tests_java/pom.xml
index 12ca2b26c..c288455d2 100644
--- a/other_langs/tests_java/pom.xml
+++ b/other_langs/tests_java/pom.xml
@@ -104,7 +104,7 @@
         </plugin>
         <plugin>
           <artifactId>maven-project-info-reports-plugin</artifactId>
-          <version>3.4.3</version>
+          <version>3.4.4</version>
         </plugin>
       </plugins>
     </pluginManagement>
diff --git a/tests/test_sns/test_topics_boto3.py b/tests/test_sns/test_topics_boto3.py
index 922909882..964b724fc 100644
--- a/tests/test_sns/test_topics_boto3.py
+++ b/tests/test_sns/test_topics_boto3.py
@@ -1,7 +1,8 @@
 import boto3
 import json
+import pytest
 
-# import sure  # noqa # pylint: disable=unused-import
+import sure  # noqa # pylint: disable=unused-import
 
 from botocore.exceptions import ClientError
 from moto import mock_sns
@@ -131,9 +132,23 @@ def test_create_topic_should_be_of_certain_length():
 def test_create_topic_in_multiple_regions():
     for region in ["us-west-1", "us-west-2"]:
         conn = boto3.client("sns", region_name=region)
-        conn.create_topic(Name="some-topic")
+        topic_arn = conn.create_topic(Name="some-topic")["TopicArn"]
+        # We can find the topic
         list(conn.list_topics()["Topics"]).should.have.length_of(1)
 
+        # We can read the Topic details
+        topic = boto3.resource("sns", region_name=region).Topic(topic_arn)
+        topic.load()
+
+    # Topic does not exist in different region though
+    with pytest.raises(ClientError) as exc:
+        sns_resource = boto3.resource("sns", region_name="eu-north-1")
+        topic = sns_resource.Topic(topic_arn)
+        topic.load()
+    err = exc.value.response["Error"]
+    assert err["Code"] == "NotFound"
+    assert err["Message"] == "Topic does not exist"
+
 
 @mock_sns
 def test_topic_corresponds_to_region():