From 83ed90525356dce47f507e045f0f3d157859b248 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?TATSUNO=20=E2=80=9CTaz=E2=80=9D=20Yasuhiro?= Date: Fri, 30 Oct 2026 19:54:57 +0900 Subject: [PATCH] test(compat): pick a home region check region other than the run's own in LambdaWebTest (#6990) --- .../src/test/java/com/floci/test/LambdaWebTest.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/LambdaWebTest.java b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/LambdaWebTest.java index ab27669316..ca393203b7 100644 --- a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/LambdaWebTest.java +++ b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/LambdaWebTest.java @@ -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.");