test(compat): pick a home region check region other than the run's own in LambdaWebTest (#6990)

This commit is contained in:
TATSUNO “Taz” Yasuhiro authored and GitHub committed 2026-10-30 06:54:57 -04:00
1 parent 5ad2f64840
commit 83ed905253
1 file changed
+3 -2
@@ -156,10 +156,11 @@ class LambdaWebTest {
.extracting(f -> f.functionName()).contains(FUNCTION_NAME);
assertThat(lambdaWeb.getWebAccountSettings(r -> {}).accountQuotas().maxEndpointsPerFunction()).isEqualTo(10);
String foreignRegion = functionArn.replace(":" + TestFixtures.region().id() + ":", ":eu-west-1:");
String otherRegion = "eu-west-1".equals(TestFixtures.region().id()) ? "us-west-2" : "eu-west-1";
String foreignRegion = functionArn.replace(":" + TestFixtures.region().id() + ":", ":" + otherRegion + ":");
assertThatThrownBy(() -> lambdaWeb.getWebFunction(r -> r.functionName(foreignRegion)))
.isInstanceOf(ValidationException.class)
.hasMessageContaining("The operation is only allowed in the function's home region eu-west-1.");
.hasMessageContaining("The operation is only allowed in the function's home region " + otherRegion + ".");
assertThatThrownBy(() -> lambdaWeb.getWebFunction(r -> r.functionName("sdk-test-no-such-web-fn")))
.isInstanceOf(ResourceNotFoundException.class)
.hasMessageContaining("does not exist.");