Skip to content
This repository was archived by the owner on Jan 17, 2025. It is now read-only.

Commit eebfa66

Browse files
falkzollsomaya10
authored andcommitted
Change username/password in Watson to apikey. (#68)
- Watson instances have been updated to IAM. They now use apikey instead of username/password.
1 parent 0250f96 commit eebfa66

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

tests/src/test/scala/runtime/integration/CredentialsIBMSwiftActionWatsonTests.scala

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ abstract class CredentialsIBMSwiftActionWatsonTests extends TestHelpers with Wsk
4040
JsonParser(ParserInput(vcapString)).asJsObject.fields("language_translator").asInstanceOf[JsArray].elements(0)
4141
val creds = vcapInfo.asJsObject.fields("credentials").asJsObject
4242
val url = creds.fields("url").asInstanceOf[JsString]
43-
val username = creds.fields("username").asInstanceOf[JsString]
44-
val password = creds.fields("password").asInstanceOf[JsString]
43+
val apikey = creds.fields("apikey").asInstanceOf[JsString]
4544

4645
/*
4746
Uses Watson Translation Service to translate the word "Hello" in English, to "Hola" in Spanish.
@@ -56,7 +55,7 @@ abstract class CredentialsIBMSwiftActionWatsonTests extends TestHelpers with Wsk
5655
file,
5756
main = Some("main"),
5857
kind = Some(actionKind),
59-
parameters = Map("url" -> url, "username" -> username, "password" -> password))
58+
parameters = Map("url" -> url, "username" -> JsString("APIKey"), "password" -> apikey))
6059
}
6160

6261
withActivation(wsk.activation, wsk.action.invoke("testWatsonAction")) { activation =>
@@ -76,7 +75,7 @@ abstract class CredentialsIBMSwiftActionWatsonTests extends TestHelpers with Wsk
7675
file,
7776
main = Some("main"),
7877
kind = Some(actionKind),
79-
parameters = Map("url" -> url, "username" -> username, "password" -> password))
78+
parameters = Map("url" -> url, "username" -> JsString("APIKey"), "password" -> apikey))
8079
}
8180

8281
withActivation(wsk.activation, wsk.action.invoke("testWatsonActionCodable")) { activation =>

0 commit comments

Comments
 (0)