use of com.ibm.watson.speech_to_text.v1.model.DeleteLanguageModelOptions in project java-sdk by watson-developer-cloud.
the class SpeechToTextTest method testDeleteLanguageModelWOptions.
// Test the deleteLanguageModel operation with a valid options model parameter
@Test
public void testDeleteLanguageModelWOptions() throws Throwable {
// Register a mock response
String mockResponseBody = "";
String deleteLanguageModelPath = "/v1/customizations/testString";
server.enqueue(new MockResponse().setResponseCode(200).setBody(mockResponseBody));
// Construct an instance of the DeleteLanguageModelOptions model
DeleteLanguageModelOptions deleteLanguageModelOptionsModel = new DeleteLanguageModelOptions.Builder().customizationId("testString").build();
// Invoke deleteLanguageModel() with a valid options model and verify the result
Response<Void> response = speechToTextService.deleteLanguageModel(deleteLanguageModelOptionsModel).execute();
assertNotNull(response);
Void responseObj = response.getResult();
assertNull(responseObj);
// Verify the contents of the request sent to the mock server
RecordedRequest request = server.takeRequest();
assertNotNull(request);
assertEquals(request.getMethod(), "DELETE");
// Verify request path
String parsedPath = TestUtilities.parseReqPath(request);
assertEquals(parsedPath, deleteLanguageModelPath);
// Verify that there is no query string
Map<String, String> query = TestUtilities.parseQueryString(request);
assertNull(query);
}
Aggregations