File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
main/java/com/amplifyframework/api/aws
test/java/com/amplifyframework/api/aws Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ public enum DomainType {
3434 CUSTOM ;
3535
3636 private static final String STANDARD_ENDPOINT_REGEX =
37- "^https:\\ /\\ /\\ w{26}\\ .appsync\\ -api\\ .\\ w{2}(?:(?: \\ -\\ w{2,})+) \\ -\\ d\\ .amazonaws.com\\ /graphql$" ;
37+ "^https:\\ /\\ /\\ w{26}\\ .appsync\\ -api\\ .\\ w{2}(?:\\ -\\ w{2,})+\\ -\\ d\\ .amazonaws.com(?: \\ .cn)? \\ /graphql$" ;
3838
3939 /**
4040 * Get Domain type based on defined endpoint.
Original file line number Diff line number Diff line change 2424public class DomainTypeTest {
2525 private static final String STANDARD_URL =
2626 "https://abcdefghijklmnopqrstuvwxyz.appsync-api.us-west-2.amazonaws.com/graphql" ;
27+ private static final String STANDARD_URL_CHINA =
28+ "https://abcdefghijklmnopqrstuvwxyz.appsync-api.us-west-2.amazonaws.com.cn/graphql" ;
2729 private static final String CUSTOM_URL = "https://something.in.somedomain.com/graphql" ;
2830
2931 /**
@@ -34,6 +36,14 @@ public void testStandardURLMatch() {
3436 Assert .assertEquals (STANDARD , DomainType .from (STANDARD_URL ));
3537 }
3638
39+ /**
40+ * Test that Domain type is {@link DomainType#STANDARD} for generated URL.
41+ */
42+ @ Test
43+ public void testStandardURLChinaMatch () {
44+ Assert .assertEquals (STANDARD , DomainType .from (STANDARD_URL_CHINA ));
45+ }
46+
3747 /**
3848 * Test that Domain type is set to {@link DomainType#CUSTOM} for custom URLs.
3949 */
You can’t perform that action at this time.
0 commit comments