@@ -17,6 +17,12 @@ class AppSyncRealTimeClientFactoryTests: XCTestCase {
17
17
AppSyncRealTimeClientFactory . appSyncRealTimeEndpoint ( appSyncEndpoint) ,
18
18
URL ( string: " wss://abc.appsync-realtime-api.amazonaws.com/graphql " )
19
19
)
20
+
21
+ let appSyncEndpointCN = URL ( string: " https://abc.appsync-api.amazonaws.com.cn/graphql " ) !
22
+ XCTAssertEqual (
23
+ AppSyncRealTimeClientFactory . appSyncRealTimeEndpoint ( appSyncEndpointCN) ,
24
+ URL ( string: " wss://abc.appsync-realtime-api.amazonaws.com.cn/graphql " )
25
+ )
20
26
}
21
27
22
28
func testAppSyncRealTimeEndpoint_withAWSAppSyncRealTimeDomain_returnTheSameDomain( ) {
@@ -25,6 +31,12 @@ class AppSyncRealTimeClientFactoryTests: XCTestCase {
25
31
AppSyncRealTimeClientFactory . appSyncRealTimeEndpoint ( appSyncEndpoint) ,
26
32
URL ( string: " wss://abc.appsync-realtime-api.amazonaws.com/graphql " )
27
33
)
34
+
35
+ let appSyncEndpointCN = URL ( string: " wss://abc.appsync-realtime-api.amazonaws.com.cn/graphql " ) !
36
+ XCTAssertEqual (
37
+ AppSyncRealTimeClientFactory . appSyncRealTimeEndpoint ( appSyncEndpointCN) ,
38
+ URL ( string: " wss://abc.appsync-realtime-api.amazonaws.com.cn/graphql " )
39
+ )
28
40
}
29
41
30
42
func testAppSyncRealTimeEndpoint_withCustomDomain_returnCorrectRealtimePath( ) {
@@ -33,6 +45,12 @@ class AppSyncRealTimeClientFactoryTests: XCTestCase {
33
45
AppSyncRealTimeClientFactory . appSyncRealTimeEndpoint ( appSyncEndpoint) ,
34
46
URL ( string: " https://test.example.com/graphql/realtime " )
35
47
)
48
+
49
+ let appSyncEndpointCN = URL ( string: " https://test.example.com.cn/graphql " ) !
50
+ XCTAssertEqual (
51
+ AppSyncRealTimeClientFactory . appSyncRealTimeEndpoint ( appSyncEndpointCN) ,
52
+ URL ( string: " https://test.example.com.cn/graphql/realtime " )
53
+ )
36
54
}
37
55
38
56
func testAppSyncApiEndpoint_withAWSAppSyncRealTimeDomain_returnCorrectApiDomain( ) {
@@ -41,6 +59,12 @@ class AppSyncRealTimeClientFactoryTests: XCTestCase {
41
59
AppSyncRealTimeClientFactory . appSyncApiEndpoint ( appSyncEndpoint) ,
42
60
URL ( string: " https://abc.appsync-api.amazonaws.com/graphql " )
43
61
)
62
+
63
+ let appSyncEndpointCN = URL ( string: " wss://abc.appsync-realtime-api.amazonaws.com.cn/graphql " ) !
64
+ XCTAssertEqual (
65
+ AppSyncRealTimeClientFactory . appSyncApiEndpoint ( appSyncEndpointCN) ,
66
+ URL ( string: " https://abc.appsync-api.amazonaws.com.cn/graphql " )
67
+ )
44
68
}
45
69
46
70
func testAppSyncApiEndpoint_withAWSAppSyncApiDomain_returnTheSameDomain( ) {
@@ -49,6 +73,12 @@ class AppSyncRealTimeClientFactoryTests: XCTestCase {
49
73
AppSyncRealTimeClientFactory . appSyncApiEndpoint ( appSyncEndpoint) ,
50
74
URL ( string: " https://abc.appsync-api.amazonaws.com/graphql " )
51
75
)
76
+
77
+ let appSyncEndpointCN = URL ( string: " https://abc.appsync-api.amazonaws.com.cn/graphql " ) !
78
+ XCTAssertEqual (
79
+ AppSyncRealTimeClientFactory . appSyncApiEndpoint ( appSyncEndpointCN) ,
80
+ URL ( string: " https://abc.appsync-api.amazonaws.com.cn/graphql " )
81
+ )
52
82
}
53
83
54
84
func testAppSyncApiEndpoint_withCustomDomain_returnCorrectRealtimePath( ) {
@@ -57,5 +87,11 @@ class AppSyncRealTimeClientFactoryTests: XCTestCase {
57
87
AppSyncRealTimeClientFactory . appSyncApiEndpoint ( appSyncEndpoint) ,
58
88
URL ( string: " https://test.example.com/graphql " )
59
89
)
90
+
91
+ let appSyncEndpointCN = URL ( string: " https://test.example.com.cn/graphql " ) !
92
+ XCTAssertEqual (
93
+ AppSyncRealTimeClientFactory . appSyncApiEndpoint ( appSyncEndpointCN) ,
94
+ URL ( string: " https://test.example.com.cn/graphql " )
95
+ )
60
96
}
61
97
}
0 commit comments