Skip to content

Commit 45d63e0

Browse files
committed
test: update tests to include authenticators internally
1 parent 68888b9 commit 45d63e0

26 files changed

Lines changed: 206 additions & 301 deletions

test/integration/test_assistant_v1.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class AssistantV1Test < Minitest::Test
1111
include Minitest::Hooks
1212
attr_accessor :service
1313
def before_all
14-
authenticator = IBMCloudSdkCore::IamAuthenticator.new(
14+
authenticator = IBMWatson::Auth::IamAuthenticator.new(
1515
apikey: ENV["ASSISTANT_APIKEY"],
1616
version: "2018-02-16"
1717
)

test/integration/test_assistant_v2.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class AssistantV2Test < Minitest::Test
1111
include Minitest::Hooks
1212
attr_accessor :service
1313
def before_all
14-
authenticator = IBMCloudSdkCore::IamAuthenticator.new(
14+
authenticator = IBMWatson::Auth::IamAuthenticator.new(
1515
apikey: ENV["ASSISTANT_APIKEY"]
1616
)
1717
@service = IBMWatson::AssistantV2.new(

test/integration/test_compare_comply_v1.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class CompareComplyV1Test < Minitest::Test
1111
attr_accessor :service, :environment_id, :collection_id
1212

1313
def before_all
14-
authenticator = IBMCloudSdkCore::IamAuthenticator.new(
14+
authenticator = IBMWatson::Auth::IamAuthenticator.new(
1515
apikey: ENV["ASSISTANT_APIKEY"]
1616
)
1717
@service = IBMWatson::CompareComplyV1.new(

test/integration/test_discovery_v1.rb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class DiscoveryV1Test < Minitest::Test
1010
attr_accessor :service, :environment_id, :collection_id
1111

1212
def before_all
13-
authenticator = IBMCloudSdkCore::IamAuthenticator.new(
13+
authenticator = IBMWatson::Auth::IamAuthenticator.new(
1414
apikey: ENV["DISCOVERY_APIKEY"]
1515
)
1616
@service = IBMWatson::DiscoveryV1.new(
@@ -203,9 +203,6 @@ def test_documents
203203
assert_equal("deleted", delete_doc["status"])
204204
end
205205

206-
# def test_queries
207-
# end
208-
209206
def test_list_credentials
210207
credentials = @service.list_credentials(
211208
environment_id: @environment_id

test/integration/test_language_translator_v3.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class LanguageTranslatorV3Test < Minitest::Test
1010
include Minitest::Hooks
1111
attr_accessor :service
1212
def before_all
13-
authenticator = IBMCloudSdkCore::IamAuthenticator.new(
13+
authenticator = IBMWatson::Auth::IamAuthenticator.new(
1414
apikey: ENV["LANGUAGE_TRANSLATOR_APIKEY"]
1515
)
1616
@service = IBMWatson::LanguageTranslatorV3.new(

test/integration/test_natural_language_classifier_v1.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class NaturalLanguageClassifierV1Test < Minitest::Test
1010
include Minitest::Hooks
1111
attr_accessor :service
1212
def before_all
13-
authenticator = IBMCloudSdkCore::IamAuthenticator.new(
13+
authenticator = IBMWatson::Auth::IamAuthenticator.new(
1414
apikey: ENV["NATURAL_LANGUAGE_CLASSIFIER_APIKEY"]
1515
)
1616
@service = IBMWatson::NaturalLanguageClassifierV1.new(

test/integration/test_natural_language_understanding_v1.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class NaturalLanguageUnderstandingV1Test < Minitest::Test
99
include Minitest::Hooks
1010
attr_accessor :service
1111
def before_all
12-
authenticator = IBMCloudSdkCore::IamAuthenticator.new(
12+
authenticator = IBMWatson::Auth::IamAuthenticator.new(
1313
apikey: ENV["NATURAL_LANGUAGE_UNDERSTANDING_APIKEY"]
1414
)
1515
@service = IBMWatson::NaturalLanguageUnderstandingV1.new(

test/integration/test_personality_insights_v3.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class PersonalityInsightsV3Test < Minitest::Test
99
include Minitest::Hooks
1010
attr_accessor :service
1111
def before_all
12-
authenticator = IBMCloudSdkCore::IamAuthenticator.new(
12+
authenticator = IBMWatson::Auth::IamAuthenticator.new(
1313
apikey: ENV["PERSONALITY_INSIGHTS_APIKEY"]
1414
)
1515
@service = IBMWatson::PersonalityInsightsV3.new(

test/integration/test_speech_to_text_v1.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class SpeechToTextV1Test < Minitest::Test
2828
include Minitest::Hooks
2929
attr_accessor :service
3030
def before_all
31-
authenticator = IBMCloudSdkCore::IamAuthenticator.new(
31+
authenticator = IBMWatson::Auth::IamAuthenticator.new(
3232
apikey: ENV["SPEECH_TO_TEXT_APIKEY"]
3333
)
3434
@service = IBMWatson::SpeechToTextV1.new(
@@ -246,7 +246,7 @@ def test_invalid_auth_using_websocket
246246
audio_file = File.open(Dir.getwd + "/resources/speech.wav")
247247
atomic_boolean = Concurrent::AtomicBoolean.new
248248
mycallback = MyRecognizeCallback.new(atomic_boolean: atomic_boolean)
249-
authenticator = IBMCloudSdkCore::BearerTokenAuthenticator.new(
249+
authenticator = IBMWatson::Auth::BearerTokenAuthenticator.new(
250250
bearer_token: "bogus_iam_access_token"
251251
)
252252
temp_service = IBMWatson::SpeechToTextV1.new(

test/integration/test_text_to_speech_v1.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class TextToSpeechV1Test < Minitest::Test
99
include Minitest::Hooks
1010
attr_accessor :service
1111
def before_all
12-
authenticator = IBMCloudSdkCore::IamAuthenticator.new(
12+
authenticator = IBMWatson::Auth::IamAuthenticator.new(
1313
apikey: ENV["TEXT_TO_SPEECH_APIKEY"]
1414
)
1515
@service = IBMWatson::TextToSpeechV1.new(

0 commit comments

Comments
 (0)