Skip to content

Commit 802de7e

Browse files
committed
transitioned to use credential file downloaded from cred service at env variable
1 parent ab89a47 commit 802de7e

16 files changed

+16
-15
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ README.md.meta
5353
Travis.meta
5454
exclude-filter.txt
5555
exclude-filter.txt.meta
56+
etc.meta
5657
/Travis/UnityTestProject/Assets/StreamingAssets/Config.json
5758
/Travis/UnityTestProject/Assets/StreamingAssets/Config.json.meta
5859
/Travis/UnityTestProject/Assets/StreamingAssets/Config.json.enc.meta

Scripts/UnitTests/TestAlchemyLanguage.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public override IEnumerator RunTest()
137137
throw new WatsonException(r.FormattedMessages);
138138

139139
// Set credentials from imported credntials
140-
Credential credential = vcapCredentials.VCAP_SERVICES["alchemy_api"][TestCredentialIndex].Credentials;
140+
Credential credential = vcapCredentials.VCAP_SERVICES["alchemy_api"];
141141
_apikey = credential.Apikey.ToString();
142142
_url = credential.Url.ToString();
143143
}

Scripts/UnitTests/TestConversation.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public override IEnumerator RunTest()
7272
throw new WatsonException(r.FormattedMessages);
7373

7474
// Set credentials from imported credntials
75-
Credential credential = vcapCredentials.VCAP_SERVICES["conversation"][TestCredentialIndex].Credentials;
75+
Credential credential = vcapCredentials.VCAP_SERVICES["conversation"];
7676
_username = credential.Username.ToString();
7777
_password = credential.Password.ToString();
7878
_url = credential.Url.ToString();

Scripts/UnitTests/TestDiscovery.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public override IEnumerator RunTest()
101101
throw new WatsonException(r.FormattedMessages);
102102

103103
// Set credentials from imported credntials
104-
Credential credential = vcapCredentials.VCAP_SERVICES["discovery"][TestCredentialIndex].Credentials;
104+
Credential credential = vcapCredentials.VCAP_SERVICES["discovery"];
105105
_username = credential.Username.ToString();
106106
_password = credential.Password.ToString();
107107
_url = credential.Url.ToString();

Scripts/UnitTests/TestDocumentConversion.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public override IEnumerator RunTest()
6969
throw new WatsonException(r.FormattedMessages);
7070

7171
// Set credentials from imported credntials
72-
Credential credential = vcapCredentials.VCAP_SERVICES["document_conversion"][TestCredentialIndex].Credentials;
72+
Credential credential = vcapCredentials.VCAP_SERVICES["document_conversion"];
7373
_username = credential.Username.ToString();
7474
_password = credential.Password.ToString();
7575
_url = credential.Url.ToString();

Scripts/UnitTests/TestLanguageTranslator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public override IEnumerator RunTest()
7979
throw new WatsonException(r.FormattedMessages);
8080

8181
// Set credentials from imported credntials
82-
Credential credential = vcapCredentials.VCAP_SERVICES["language_translator"][TestCredentialIndex].Credentials;
82+
Credential credential = vcapCredentials.VCAP_SERVICES["language_translator"];
8383
_username = credential.Username.ToString();
8484
_password = credential.Password.ToString();
8585
_url = credential.Url.ToString();

Scripts/UnitTests/TestNaturalLanguageClassifier.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public override IEnumerator RunTest()
8787
throw new WatsonException(r.FormattedMessages);
8888

8989
// Set credentials from imported credntials
90-
Credential credential = vcapCredentials.VCAP_SERVICES["natural_language_classifier"][TestCredentialIndex].Credentials;
90+
Credential credential = vcapCredentials.VCAP_SERVICES["natural_language_classifier"];
9191
_username = credential.Username.ToString();
9292
_password = credential.Password.ToString();
9393
_url = credential.Url.ToString();

Scripts/UnitTests/TestNaturalLanguageUnderstanding.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public override IEnumerator RunTest()
6868
throw new WatsonException(r.FormattedMessages);
6969

7070
// Set credentials from imported credntials
71-
Credential credential = vcapCredentials.VCAP_SERVICES["natural_language_understanding"][TestCredentialIndex].Credentials;
71+
Credential credential = vcapCredentials.VCAP_SERVICES["natural_language_understanding"];
7272
_username = credential.Username.ToString();
7373
_password = credential.Password.ToString();
7474
_url = credential.Url.ToString();

Scripts/UnitTests/TestPersonalityInsights.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public override IEnumerator RunTest()
7575
throw new WatsonException(r.FormattedMessages);
7676

7777
// Set credentials from imported credntials
78-
Credential credential = vcapCredentials.VCAP_SERVICES["personality_insights"][TestCredentialIndex].Credentials;
78+
Credential credential = vcapCredentials.VCAP_SERVICES["personality_insights"];
7979
_username = credential.Username.ToString();
8080
_password = credential.Password.ToString();
8181
_url = credential.Url.ToString();

Scripts/UnitTests/TestRetrieveAndRank.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public override IEnumerator RunTest()
114114
throw new WatsonException(r.FormattedMessages);
115115

116116
// Set credentials from imported credntials
117-
Credential credential = vcapCredentials.VCAP_SERVICES["retrieve_and_rank"][TestCredentialIndex].Credentials;
117+
Credential credential = vcapCredentials.VCAP_SERVICES["retrieve_and_rank"];
118118
_username = credential.Username.ToString();
119119
_password = credential.Password.ToString();
120120
_url = credential.Url.ToString();

Scripts/UnitTests/TestSpeechToText.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public override IEnumerator RunTest()
115115
throw new WatsonException(r.FormattedMessages);
116116

117117
// Set credentials from imported credntials
118-
Credential credential = vcapCredentials.VCAP_SERVICES["speech_to_text"][TestCredentialIndex].Credentials;
118+
Credential credential = vcapCredentials.VCAP_SERVICES["speech_to_text"];
119119
_username = credential.Username.ToString();
120120
_password = credential.Password.ToString();
121121
_url = credential.Url.ToString();

Scripts/UnitTests/TestTextToSpeech.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public override IEnumerator RunTest()
9090
throw new WatsonException(r.FormattedMessages);
9191

9292
// Set credentials from imported credntials
93-
Credential credential = vcapCredentials.VCAP_SERVICES["text_to_speech"][TestCredentialIndex].Credentials;
93+
Credential credential = vcapCredentials.VCAP_SERVICES["text_to_speech"];
9494
_username = credential.Username.ToString();
9595
_password = credential.Password.ToString();
9696
_url = credential.Url.ToString();

Scripts/UnitTests/TestToneAnalyzer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public override IEnumerator RunTest()
6969
throw new WatsonException(r.FormattedMessages);
7070

7171
// Set credentials from imported credntials
72-
Credential credential = vcapCredentials.VCAP_SERVICES["tone_analyzer"][TestCredentialIndex].Credentials;
72+
Credential credential = vcapCredentials.VCAP_SERVICES["tone_analyzer"];
7373
_username = credential.Username.ToString();
7474
_password = credential.Password.ToString();
7575
_url = credential.Url.ToString();

Scripts/UnitTests/TestTradeoffAnalytics.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public override IEnumerator RunTest()
6868
throw new WatsonException(r.FormattedMessages);
6969

7070
// Set credentials from imported credntials
71-
Credential credential = vcapCredentials.VCAP_SERVICES["tradeoff_analytics"][TestCredentialIndex].Credentials;
71+
Credential credential = vcapCredentials.VCAP_SERVICES["tradeoff_analytics"];
7272
_username = credential.Username.ToString();
7373
_password = credential.Password.ToString();
7474
_url = credential.Url.ToString();

Scripts/UnitTests/TestVisualRecognition.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public override IEnumerator RunTest()
9191
throw new WatsonException(r.FormattedMessages);
9292

9393
// Set credentials from imported credntials
94-
Credential credential = vcapCredentials.VCAP_SERVICES["visual_recognition"][TestCredentialIndex].Credentials;
94+
Credential credential = vcapCredentials.VCAP_SERVICES["visual_recognition"];
9595
_apikey = credential.Apikey.ToString();
9696
_url = credential.Url.ToString();
9797
}

Scripts/Utilities/Credentials.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public bool HasApiKey()
127127
[fsObject]
128128
public class VcapCredentials
129129
{
130-
public Dictionary<string, List<VcapCredential>> VCAP_SERVICES { get; set; }
130+
public Dictionary<string, Credential> VCAP_SERVICES { get; set; }
131131
}
132132

133133
[fsObject]

0 commit comments

Comments
 (0)