use of com.ibm.watson.speech_to_text.v1.model.ListWordsOptions in project java-sdk by watson-developer-cloud.
the class CustomizationsIT method testAddWords.
/**
* Test add words and list words.
*/
@Test
public void testAddWords() {
model = createVoiceModel();
final List<Word> expected = instantiateWords();
AddWordsOptions addOptions = new AddWordsOptions.Builder().customizationId(model.getCustomizationId()).words(expected).build();
service.addWords(addOptions).execute();
ListWordsOptions listOptions = new ListWordsOptions.Builder().customizationId(model.getCustomizationId()).build();
final Words words = service.listWords(listOptions).execute();
assertEquals(expected.size(), words.getWords().size());
}
use of com.ibm.watson.speech_to_text.v1.model.ListWordsOptions in project java-sdk by watson-developer-cloud.
the class CustomizationsTest method testListWords.
/**
* Test list words.
*
* @throws InterruptedException the interrupted exception
*/
@Test
public void testListWords() throws InterruptedException {
final List<Word> expected = instantiateWords();
server.enqueue(jsonResponse(ImmutableMap.of(WORDS, expected)));
ListWordsOptions listOptions = new ListWordsOptions.Builder().customizationId(CUSTOMIZATION_ID).build();
final Words result = service.listWords(listOptions).execute();
final RecordedRequest request = server.takeRequest();
assertEquals(String.format(WORDS_PATH, CUSTOMIZATION_ID), request.getPath());
assertEquals("GET", request.getMethod());
assertEquals(expected, result.getWords());
}
use of com.ibm.watson.speech_to_text.v1.model.ListWordsOptions in project java-sdk by watson-developer-cloud.
the class SpeechToTextIT method testListWordsCustomizationId.
/**
* Test list words with just a customization ID.
*/
@Test
@Ignore
public void testListWordsCustomizationId() {
ListWordsOptions listOptions = new ListWordsOptions.Builder().customizationId(customizationId).build();
Words result = service.listWords(listOptions).execute().getResult();
assertNotNull(result);
assertTrue(!result.getWords().isEmpty());
}
Aggregations