@@ -71,7 +71,7 @@ func TestInternetConnectionCheck_RTN17c(t *testing.T) {
71
71
func TestHosts_REC1 (t * testing.T ) {
72
72
t .Run ("REC1a with default options" , func (t * testing.T ) {
73
73
clientOptions := ably .NewClientOptions ()
74
- assert .Equal (t , "main.realtime.ably.net" , clientOptions .GetEndpoint ())
74
+ assert .Equal (t , "main.realtime.ably.net" , clientOptions .GetHostname ())
75
75
assert .False (t , clientOptions .NoTLS )
76
76
port , isDefaultPort := clientOptions .ActivePort ()
77
77
assert .Equal (t , 443 , port )
@@ -82,7 +82,7 @@ func TestHosts_REC1(t *testing.T) {
82
82
83
83
t .Run ("REC1b with endpoint as a custom routing policy name" , func (t * testing.T ) {
84
84
clientOptions := ably .NewClientOptions (ably .WithEndpoint ("acme" ))
85
- assert .Equal (t , "acme.realtime.ably.net" , clientOptions .GetEndpoint ())
85
+ assert .Equal (t , "acme.realtime.ably.net" , clientOptions .GetHostname ())
86
86
assert .False (t , clientOptions .NoTLS )
87
87
port , isDefaultPort := clientOptions .ActivePort ()
88
88
assert .Equal (t , 443 , port )
@@ -93,7 +93,7 @@ func TestHosts_REC1(t *testing.T) {
93
93
94
94
t .Run ("REC1b3 with endpoint as a nonprod routing policy name" , func (t * testing.T ) {
95
95
clientOptions := ably .NewClientOptions (ably .WithEndpoint ("nonprod:acme" ))
96
- assert .Equal (t , "acme.realtime.ably-nonprod.net" , clientOptions .GetEndpoint ())
96
+ assert .Equal (t , "acme.realtime.ably-nonprod.net" , clientOptions .GetHostname ())
97
97
assert .False (t , clientOptions .NoTLS )
98
98
port , isDefaultPort := clientOptions .ActivePort ()
99
99
assert .Equal (t , 443 , port )
@@ -104,7 +104,7 @@ func TestHosts_REC1(t *testing.T) {
104
104
105
105
t .Run ("REC1b2 with endpoint as a fqdn with no fallbackHosts specified" , func (t * testing.T ) {
106
106
clientOptions := ably .NewClientOptions (ably .WithEndpoint ("foo.example.com" ))
107
- assert .Equal (t , "foo.example.com" , clientOptions .GetEndpoint ())
107
+ assert .Equal (t , "foo.example.com" , clientOptions .GetHostname ())
108
108
assert .False (t , clientOptions .NoTLS )
109
109
port , isDefaultPort := clientOptions .ActivePort ()
110
110
assert .Equal (t , 443 , port )
@@ -116,7 +116,7 @@ func TestHosts_REC1(t *testing.T) {
116
116
117
117
t .Run ("REC1b2 REC2a2 with endpoint as a fqdn with fallbackHosts specified" , func (t * testing.T ) {
118
118
clientOptions := ably .NewClientOptions (ably .WithEndpoint ("foo.example.com" ), ably .WithFallbackHosts ([]string {"fallback.foo.example.com" }))
119
- assert .Equal (t , "foo.example.com" , clientOptions .GetEndpoint ())
119
+ assert .Equal (t , "foo.example.com" , clientOptions .GetHostname ())
120
120
assert .False (t , clientOptions .NoTLS )
121
121
port , isDefaultPort := clientOptions .ActivePort ()
122
122
assert .Equal (t , 443 , port )
@@ -129,7 +129,7 @@ func TestHosts_REC1(t *testing.T) {
129
129
t .Run ("legacy support" , func (t * testing.T ) {
130
130
t .Run ("REC1c with production environment" , func (t * testing.T ) {
131
131
clientOptions := ably .NewClientOptions (ably .WithEnvironment ("production" ))
132
- assert .Equal (t , "main.realtime.ably.net" , clientOptions .GetEndpoint ())
132
+ assert .Equal (t , "main.realtime.ably.net" , clientOptions .GetHostname ())
133
133
assert .False (t , clientOptions .NoTLS )
134
134
port , isDefaultPort := clientOptions .ActivePort ()
135
135
assert .Equal (t , 443 , port )
@@ -140,7 +140,7 @@ func TestHosts_REC1(t *testing.T) {
140
140
141
141
t .Run ("REC1c with sandbox environment" , func (t * testing.T ) {
142
142
clientOptions := ably .NewClientOptions (ably .WithEnvironment ("sandbox" ))
143
- assert .Equal (t , "sandbox.realtime.ably-nonprod.net" , clientOptions .GetEndpoint ())
143
+ assert .Equal (t , "sandbox.realtime.ably-nonprod.net" , clientOptions .GetHostname ())
144
144
assert .False (t , clientOptions .NoTLS )
145
145
port , isDefaultPort := clientOptions .ActivePort ()
146
146
assert .Equal (t , 443 , port )
@@ -151,7 +151,7 @@ func TestHosts_REC1(t *testing.T) {
151
151
152
152
t .Run ("REC1c with custom environment" , func (t * testing.T ) {
153
153
clientOptions := ably .NewClientOptions (ably .WithEnvironment ("acme" ))
154
- assert .Equal (t , "acme.realtime.ably.net" , clientOptions .GetEndpoint ())
154
+ assert .Equal (t , "acme.realtime.ably.net" , clientOptions .GetHostname ())
155
155
assert .False (t , clientOptions .NoTLS )
156
156
port , isDefaultPort := clientOptions .ActivePort ()
157
157
assert .Equal (t , 443 , port )
@@ -162,7 +162,7 @@ func TestHosts_REC1(t *testing.T) {
162
162
163
163
t .Run ("REC1c REC2a1 with custom environment and fallbackHostUseDefault" , func (t * testing.T ) {
164
164
clientOptions := ably .NewClientOptions (ably .WithEnvironment ("acme" ), ably .WithFallbackHostsUseDefault (true ))
165
- assert .Equal (t , "acme.realtime.ably.net" , clientOptions .GetEndpoint ())
165
+ assert .Equal (t , "acme.realtime.ably.net" , clientOptions .GetHostname ())
166
166
assert .False (t , clientOptions .NoTLS )
167
167
port , isDefaultPort := clientOptions .ActivePort ()
168
168
assert .Equal (t , 443 , port )
@@ -177,7 +177,7 @@ func TestHosts_REC1(t *testing.T) {
177
177
ably .WithPort (8080 ),
178
178
ably .WithTLSPort (8081 ),
179
179
)
180
- assert .Equal (t , "local.realtime.ably.net" , clientOptions .GetEndpoint ())
180
+ assert .Equal (t , "local.realtime.ably.net" , clientOptions .GetHostname ())
181
181
assert .False (t , clientOptions .NoTLS )
182
182
port , isDefaultPort := clientOptions .ActivePort ()
183
183
assert .Equal (t , 8081 , port )
@@ -188,7 +188,7 @@ func TestHosts_REC1(t *testing.T) {
188
188
189
189
t .Run ("REC1d1 with custom restHost" , func (t * testing.T ) {
190
190
clientOptions := ably .NewClientOptions (ably .WithRESTHost ("test.org" ))
191
- assert .Equal (t , "test.org" , clientOptions .GetEndpoint ())
191
+ assert .Equal (t , "test.org" , clientOptions .GetHostname ())
192
192
assert .False (t , clientOptions .NoTLS )
193
193
port , isDefaultPort := clientOptions .ActivePort ()
194
194
assert .Equal (t , 443 , port )
@@ -199,7 +199,7 @@ func TestHosts_REC1(t *testing.T) {
199
199
200
200
t .Run ("REC1d2 with custom realtimeHost" , func (t * testing.T ) {
201
201
clientOptions := ably .NewClientOptions (ably .WithRealtimeHost ("ws.test.org" ))
202
- assert .Equal (t , "ws.test.org" , clientOptions .GetEndpoint ())
202
+ assert .Equal (t , "ws.test.org" , clientOptions .GetHostname ())
203
203
assert .False (t , clientOptions .NoTLS )
204
204
port , isDefaultPort := clientOptions .ActivePort ()
205
205
assert .Equal (t , 443 , port )
@@ -210,7 +210,7 @@ func TestHosts_REC1(t *testing.T) {
210
210
211
211
t .Run ("REC1d with custom restHost and realtimeHost" , func (t * testing.T ) {
212
212
clientOptions := ably .NewClientOptions (ably .WithRealtimeHost ("ws.test.org" ), ably .WithRESTHost ("test.org" ))
213
- assert .Equal (t , "test.org" , clientOptions .GetEndpoint ())
213
+ assert .Equal (t , "test.org" , clientOptions .GetHostname ())
214
214
assert .False (t , clientOptions .NoTLS )
215
215
port , isDefaultPort := clientOptions .ActivePort ()
216
216
assert .Equal (t , 443 , port )
@@ -224,7 +224,7 @@ func TestHosts_REC1(t *testing.T) {
224
224
ably .WithRealtimeHost ("ws.test.org" ),
225
225
ably .WithRESTHost ("test.org" ),
226
226
ably .WithFallbackHostsUseDefault (true ))
227
- assert .Equal (t , "test.org" , clientOptions .GetEndpoint ())
227
+ assert .Equal (t , "test.org" , clientOptions .GetHostname ())
228
228
assert .False (t , clientOptions .NoTLS )
229
229
port , isDefaultPort := clientOptions .ActivePort ()
230
230
assert .Equal (t , 443 , port )
@@ -236,7 +236,7 @@ func TestHosts_REC1(t *testing.T) {
236
236
237
237
t .Run ("REC2a with fallbackHosts" , func (t * testing.T ) {
238
238
clientOptions := ably .NewClientOptions (ably .WithFallbackHosts ([]string {"a.example.com" , "b.example.com" }))
239
- assert .Equal (t , "main.realtime.ably.net" , clientOptions .GetEndpoint ())
239
+ assert .Equal (t , "main.realtime.ably.net" , clientOptions .GetHostname ())
240
240
assert .False (t , clientOptions .NoTLS )
241
241
port , isDefaultPort := clientOptions .ActivePort ()
242
242
assert .Equal (t , 443 , port )
0 commit comments