22require_relative '../test'
33
44class Vonage ::NetworkAuthentication ::ServerAuthenticationTest < Vonage ::Test
5- def server
5+ def server_authentication
66 Vonage ::NetworkAuthentication ::ServerAuthentication . new ( config )
77 end
88
@@ -34,22 +34,22 @@ def test_bc_authorize_method
3434
3535 stub_request ( :post , bc_authorize_uri ) . with ( request ( body : request_params , headers : headers ) ) . to_return ( network_authentication_oicd_response )
3636
37- response = server . bc_authorize ( purpose : example_purpose , api_scope : example_api_scope , login_hint : example_login_hint )
37+ response = server_authentication . bc_authorize ( purpose : example_purpose , api_scope : example_api_scope , login_hint : example_login_hint )
3838
3939 assert_kind_of Vonage ::Response , response
4040 assert_equal network_authentication_auth_request_id , response . auth_req_id
4141 end
4242
4343 def test_bc_authorize_method_without_purpose
44- assert_raises ( ArgumentError ) { server . bc_authorize ( api_scope : example_api_scope , login_hint : example_login_hint ) }
44+ assert_raises ( ArgumentError ) { server_authentication . bc_authorize ( api_scope : example_api_scope , login_hint : example_login_hint ) }
4545 end
4646
4747 def test_bc_authorize_method_without_api_scope
48- assert_raises ( ArgumentError ) { server . bc_authorize ( purpose : example_purpose , login_hint : example_login_hint ) }
48+ assert_raises ( ArgumentError ) { server_authentication . bc_authorize ( purpose : example_purpose , login_hint : example_login_hint ) }
4949 end
5050
5151 def test_bc_authorize_method_without_login_hint
52- assert_raises ( ArgumentError ) { server . bc_authorize ( purpose : example_purpose , api_scope : example_api_scope ) }
52+ assert_raises ( ArgumentError ) { server_authentication . bc_authorize ( purpose : example_purpose , api_scope : example_api_scope ) }
5353 end
5454
5555 def test_request_access_token_method
@@ -60,14 +60,14 @@ def test_request_access_token_method
6060
6161 stub_request ( :post , token_uri ) . with ( request ( body : request_params , headers : headers ) ) . to_return ( network_authentication_token_response )
6262
63- response = server . request_access_token ( auth_req_id : network_authentication_auth_request_id )
63+ response = server_authentication . request_access_token ( auth_req_id : network_authentication_auth_request_id )
6464
6565 assert_kind_of Vonage ::Response , response
6666 assert_equal sample_webhook_token , response . access_token
6767 end
6868
6969 def test_request_access_token_method_without_auth_req_id
70- assert_raises ( ArgumentError ) { server . request_access_token }
70+ assert_raises ( ArgumentError ) { server_authentication . request_access_token }
7171 end
7272
7373 def test_token_method
@@ -84,18 +84,18 @@ def test_token_method
8484 stub_request ( :post , bc_authorize_uri ) . with ( request ( body : bc_authorize_request_params , headers : headers ) ) . to_return ( network_authentication_oicd_response )
8585 stub_request ( :post , token_uri ) . with ( request ( body : request_access_token_request_params , headers : headers ) ) . to_return ( network_authentication_token_response )
8686
87- assert_equal sample_webhook_token , server . token ( purpose : example_purpose , api_scope : example_api_scope , login_hint : example_login_hint )
87+ assert_equal sample_webhook_token , server_authentication . token ( purpose : example_purpose , api_scope : example_api_scope , login_hint : example_login_hint )
8888 end
8989
9090 def test_token_method_without_purpose
91- assert_raises ( ArgumentError ) { server . token ( api_scope : example_api_scope , login_hint : example_login_hint ) }
91+ assert_raises ( ArgumentError ) { server_authentication . token ( api_scope : example_api_scope , login_hint : example_login_hint ) }
9292 end
9393
9494 def test_token_method_without_api_scope
95- assert_raises ( ArgumentError ) { server . token ( purpose : example_purpose , login_hint : example_login_hint ) }
95+ assert_raises ( ArgumentError ) { server_authentication . token ( purpose : example_purpose , login_hint : example_login_hint ) }
9696 end
9797
9898 def test_token_method_without_login_hint
99- assert_raises ( ArgumentError ) { server . token ( purpose : example_purpose , api_scope : example_api_scope ) }
99+ assert_raises ( ArgumentError ) { server_authentication . token ( purpose : example_purpose , api_scope : example_api_scope ) }
100100 end
101101end
0 commit comments