test/test_client.rb in ringcentral_sdk-2.3.0 vs test/test_client.rb in ringcentral_sdk-3.0.0

- old
+ new

@@ -5,25 +5,25 @@ class RingCentralSdkPlatformTest < Test::Unit::TestCase def setup @rcsdk = RingCentralSdk::REST::Client.new do |config| config.server_url = RingCentralSdk::RC_SERVER_SANDBOX - config.app_key = 'my_app_key' - config.app_secret = 'my_app_secret' + config.client_id = 'my_app_client_id' + config.client_secret = 'my_app_client_secret' end end def test_main - assert_equal 'bXlfYXBwX2tleTpteV9hcHBfc2VjcmV0', @rcsdk.send(:api_key) + assert_equal 'bXlfYXBwX2NsaWVudF9pZDpteV9hcHBfY2xpZW50X3NlY3JldA==', @rcsdk.send(:api_key) end def test_config redirect_url = 'http://localhost:4567/oauth' client = RingCentralSdk::REST::Client.new do |config| config.server_url = RingCentralSdk::RC_SERVER_SANDBOX - config.app_key = 'my_app_key' - config.app_secret = 'my_app_secret' + config.client_id = 'my_app_client_id' + config.client_secret = 'my_app_client_secret' config.redirect_url = redirect_url end assert_equal redirect_url, client.config.redirect_url end @@ -34,12 +34,12 @@ rcsdk.set_oauth2_client assert_equal true, rcsdk.oauth2client.is_a?(OAuth2::Client) rcsdk = new_client oauth2client = OAuth2::Client.new( - 'my_app_key', - 'my_app_secret', + 'my_app_client_id', + 'my_app_client_secret', site: RingCentralSdk::RC_SERVER_SANDBOX, token_url: rcsdk.class::TOKEN_ENDPOINT ) rcsdk.set_oauth2_client oauth2client assert_equal true, rcsdk.oauth2client.is_a?(OAuth2::Client) @@ -62,12 +62,12 @@ end end def test_authorize_url_default rcsdk = RingCentralSdk::REST::Client.new do |config| - config.app_key = 'my_app_key' - config.app_secret = 'my_app_secret' + config.client_id = 'my_app_client_id' + config.client_secret = 'my_app_client_secret' config.server_url = RingCentralSdk::RC_SERVER_PRODUCTION config.redirect_url = 'http://localhost:4567/oauth' end authorize_url = rcsdk.authorize_url @@ -115,12 +115,12 @@ token = rcsdk.authorize_code('my_test_auth_code') assert_equal 'OAuth2::AccessToken', token.class.name assert_equal 'OAuth2::AccessToken', rcsdk.token.class.name rcsdk = RingCentralSdk::REST::Client.new do |config| - config.app_key = 'my_app_key' - config.app_secret = 'my_app_secret' + config.client_id = 'my_app_client_id' + config.client_secret = 'my_app_client_secret' config.server_url = RingCentralSdk::RC_SERVER_SANDBOX config.redirect_url = 'http://localhost:4567/oauth' end rcsdk.set_oauth2_client @@ -301,11 +301,11 @@ assert_equal 'Faraday::Response', res.class.name end def new_client RingCentralSdk::REST::Client.new do |config| - config.app_key = 'my_app_key' - config.app_secret = 'my_app_secret' + config.client_id = 'my_app_client_id' + config.client_secret = 'my_app_client_secret' config.server_url = RingCentralSdk::RC_SERVER_PRODUCTION end end def data_auth_token_with_refresh