use of com.ibm.watson.developer_cloud.natural_language_classifier.v1.model.DeleteClassifierOptions in project java-sdk by watson-developer-cloud.
the class VisualRecognitionIT method testDeleteAllClassifiers.
/**
* Delete all the visual classifiers.
*/
@Test
@Ignore
public void testDeleteAllClassifiers() {
List<Classifier> classifiers = service.listClassifiers(null).execute().getClassifiers();
for (Classifier classifier : classifiers) {
if (!classifier.getClassifierId().equals(classifierId)) {
DeleteClassifierOptions deleteOptions = new DeleteClassifierOptions.Builder(classifier.getClassifierId()).build();
service.deleteClassifier(deleteOptions).execute();
}
}
}
use of com.ibm.watson.developer_cloud.natural_language_classifier.v1.model.DeleteClassifierOptions in project java-sdk by watson-developer-cloud.
the class VisualRecognitionTest method testDeleteClassifier.
/**
* Test delete classifier.
*
* @throws IOException Signals that an I/O exception has occurred.
* @throws InterruptedException the interrupted exception
*/
@Test
public void testDeleteClassifier() throws IOException, InterruptedException {
server.enqueue(new MockResponse().setBody(""));
String class1 = "class1";
DeleteClassifierOptions options = new DeleteClassifierOptions.Builder(class1).build();
service.deleteClassifier(options).execute();
// first request
RecordedRequest request = server.takeRequest();
String path = String.format(PATH_CLASSIFIER + "?" + VERSION_DATE + "=2016-05-20&api_key=" + API_KEY, class1);
assertEquals(path, request.getPath());
assertEquals("DELETE", request.getMethod());
}
Aggregations