|
16 | 16 | import com.google.gson.JsonObject; |
17 | 17 | import com.google.gson.JsonParser; |
18 | 18 | import com.ibm.cloud.sdk.core.http.HttpMediaType; |
19 | | -import com.ibm.cloud.sdk.core.security.basicauth.BasicAuthConfig; |
| 19 | +import com.ibm.cloud.sdk.core.security.NoAuthAuthenticator; |
20 | 20 | import com.ibm.cloud.sdk.core.util.GsonSingleton; |
21 | 21 | import com.ibm.cloud.sdk.core.util.RequestUtils; |
22 | 22 | import com.ibm.watson.common.TestUtils; |
@@ -169,11 +169,7 @@ public class SpeechToTextTest extends WatsonServiceUnitTest { |
169 | 169 | public void setUp() throws Exception { |
170 | 170 | super.setUp(); |
171 | 171 |
|
172 | | - BasicAuthConfig authConfig = new BasicAuthConfig.Builder() |
173 | | - .username("") |
174 | | - .password("") |
175 | | - .build(); |
176 | | - service = new SpeechToText(authConfig); |
| 172 | + service = new SpeechToText(new NoAuthAuthenticator()); |
177 | 173 | service.setEndPoint(getMockWebServerUrl()); |
178 | 174 |
|
179 | 175 | speechModel = loadFixture("src/test/resources/speech_to_text/speech-model.json", SpeechModel.class); |
@@ -1119,10 +1115,11 @@ public void testAddWords() throws InterruptedException, FileNotFoundException { |
1119 | 1115 | wordsAsMap.put("words", new Word[] { newWord }); |
1120 | 1116 | server.enqueue(new MockResponse().addHeader(CONTENT_TYPE, HttpMediaType.APPLICATION_JSON).setBody("{}")); |
1121 | 1117 |
|
1122 | | - CustomWord word = new CustomWord(); |
1123 | | - word.setWord(newWord.getWord()); |
1124 | | - word.setDisplayAs(newWord.getDisplayAs()); |
1125 | | - word.setSoundsLike(newWord.getSoundsLike()); |
| 1118 | + CustomWord word = new CustomWord.Builder() |
| 1119 | + .word(newWord.getWord()) |
| 1120 | + .displayAs(newWord.getDisplayAs()) |
| 1121 | + .soundsLike(newWord.getSoundsLike()) |
| 1122 | + .build(); |
1126 | 1123 |
|
1127 | 1124 | AddWordsOptions addOptions = new AddWordsOptions.Builder() |
1128 | 1125 | .customizationId(id) |
@@ -1489,8 +1486,8 @@ public void testClosingInputStreamClosesWebSocket() throws Exception { |
1489 | 1486 | outputStream.write(ByteString.encodeUtf8("test").toByteArray()); |
1490 | 1487 | outputStream.close(); |
1491 | 1488 |
|
1492 | | - webSocketRecorder.assertTextMessage("{\"customization_weight\":0.1," |
1493 | | - + "\"content-type\":\"audio/l16; rate=44000\",\"action\":\"start\"}"); |
| 1489 | + webSocketRecorder.assertTextMessage("{\"content-type\":\"audio/l16; rate=44000\"," + |
| 1490 | + "\"customization_weight\":0.1,\"action\":\"start\"}"); |
1494 | 1491 | webSocketRecorder.assertBinaryMessage(ByteString.encodeUtf8("test")); |
1495 | 1492 | webSocketRecorder.assertTextMessage("{\"action\":\"stop\"}"); |
1496 | 1493 | webSocketRecorder.assertExhausted(); |
|
0 commit comments