/** * Get information about a classifier. * * This method is here for backwards-compatibility with the old version of getClassifier. * * @param classifierId the classifier ID * @return the classifier */ public ServiceCall<Classifier> getClassifier(String classifierId) { GetClassifierOptions getClassifierOptions = new GetClassifierOptions.Builder() .classifierId(classifierId) .build(); return getClassifier(getClassifierOptions); }
/** * Get information about a classifier. * * This method is here for backwards-compatibility with the old version of getClassifier. * * @param classifierId the classifier ID * @return the classifier */ public ServiceCall<Classifier> getClassifier(String classifierId) { GetClassifierOptions getClassifierOptions = new GetClassifierOptions.Builder() .classifierId(classifierId) .build(); return getClassifier(getClassifierOptions); }
/** * Test get classifier. * * @throws InterruptedException the interrupted exception */ @Test public void testGetClassifier() throws InterruptedException { server.enqueue(jsonResponse(classifier)); GetClassifierOptions getOptions = new GetClassifierOptions.Builder() .classifierId(classifierId) .build(); final Classifier response = service.getClassifier(getOptions).execute(); final RecordedRequest request = server.takeRequest(); assertEquals(CLASSIFIERS_PATH + "/" + classifierId, request.getPath()); assertEquals(classifier, response); }
/** * Test get classifier. */ @Test public void bGetClassifier() { final Classifier classifier; try { GetClassifierOptions getOptions = new GetClassifierOptions.Builder() .classifierId(classifierId) .build(); classifier = service.getClassifier(getOptions).execute(); } catch (NotFoundException e) { // #324: Classifiers may be empty, because of other tests interfering. // The build should not fail here, because this is out of our control. throw new AssumptionViolatedException(e.getMessage(), e); } assertNotNull(classifier); assertEquals(classifierId, classifier.getClassifierId()); assertEquals(Classifier.Status.TRAINING, classifier.getStatus()); }