Search in sources :

Example 1 with DeleteCorpusOptions

use of com.ibm.watson.developer_cloud.speech_to_text.v1.model.DeleteCorpusOptions in project java-sdk by watson-developer-cloud.

the class SpeechToTextTest method testDeleteCorpus.

/**
 * Test delete corpus.
 *
 * @throws InterruptedException the interrupted exception
 * @throws FileNotFoundException the file not found exception
 */
@Test
public void testDeleteCorpus() throws InterruptedException, FileNotFoundException {
    String id = "foo";
    String corpus = "cName";
    server.enqueue(new MockResponse().addHeader(CONTENT_TYPE, HttpMediaType.APPLICATION_JSON).setBody("{}"));
    DeleteCorpusOptions deleteOptions = new DeleteCorpusOptions.Builder().customizationId(id).corpusName(corpus).build();
    service.deleteCorpus(deleteOptions).execute();
    final RecordedRequest request = server.takeRequest();
    assertEquals("DELETE", request.getMethod());
    assertEquals(String.format(PATH_CORPUS, id, corpus), request.getPath());
}
Also used : RecordedRequest(okhttp3.mockwebserver.RecordedRequest) MockResponse(okhttp3.mockwebserver.MockResponse) DeleteCorpusOptions(com.ibm.watson.developer_cloud.speech_to_text.v1.model.DeleteCorpusOptions) ByteString(okio.ByteString) WatsonServiceUnitTest(com.ibm.watson.developer_cloud.WatsonServiceUnitTest) Test(org.junit.Test)

Aggregations

WatsonServiceUnitTest (com.ibm.watson.developer_cloud.WatsonServiceUnitTest)1 DeleteCorpusOptions (com.ibm.watson.developer_cloud.speech_to_text.v1.model.DeleteCorpusOptions)1 MockResponse (okhttp3.mockwebserver.MockResponse)1 RecordedRequest (okhttp3.mockwebserver.RecordedRequest)1 ByteString (okio.ByteString)1 Test (org.junit.Test)1