VisualRecognition extends BaseService { public ServiceCall<Classifiers> listClassifiers(ListClassifiersOptions listClassifiersOptions) { String[] pathSegments = {"v3/classifiers"}; RequestBuilder builder = RequestBuilder.get(RequestBuilder.constructHttpUrl(getServiceUrl(), pathSegments)); builder.query("version", versionDate); Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("watson_vision_combined", "v3", "listClassifiers"); for (Entry<String, String> header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); if (listClassifiersOptions != null) { if (listClassifiersOptions.verbose() != null) { builder.query("verbose", String.valueOf(listClassifiersOptions.verbose())); } } ResponseConverter<Classifiers> responseConverter = ResponseConverterUtils.getValue( new com.google.gson.reflect.TypeToken<Classifiers>() {}.getType()); return createServiceCall(builder.build(), responseConverter); } VisualRecognition(String versionDate);  VisualRecognition(String versionDate, Authenticator authenticator);  VisualRecognition(String versionDate, String serviceName);  VisualRecognition(String versionDate, String serviceName, Authenticator authenticator); ServiceCall<ClassifiedImages> classify(ClassifyOptions classifyOptions); ServiceCall<ClassifiedImages> classify(); ServiceCall<Classifier> createClassifier(CreateClassifierOptions createClassifierOptions); ServiceCall<Classifiers> listClassifiers(ListClassifiersOptions listClassifiersOptions); ServiceCall<Classifiers> listClassifiers(); ServiceCall<Classifier> getClassifier(GetClassifierOptions getClassifierOptions); ServiceCall<Classifier> updateClassifier(UpdateClassifierOptions updateClassifierOptions); ServiceCall<Void> deleteClassifier(DeleteClassifierOptions deleteClassifierOptions); ServiceCall<InputStream> getCoreMlModel(GetCoreMlModelOptions getCoreMlModelOptions); ServiceCall<Void> deleteUserData(DeleteUserDataOptions deleteUserDataOptions);  }
@Test public void testGetClassifiers() throws InterruptedException, IOException { Classifier mockClassifier = loadFixture(FIXTURE_CLASSIFIER, Classifier.class); List<Classifier> classifiers = new ArrayList<>(); classifiers.add(mockClassifier); classifiers.add(mockClassifier); classifiers.add(mockClassifier); JsonObject mockResponse = new JsonObject(); mockResponse.add("classifiers", new Gson().toJsonTree(classifiers)); server.enqueue(new MockResponse().setBody(mockResponse.toString())); ListClassifiersOptions options = new ListClassifiersOptions.Builder().verbose(true).build(); List<Classifier> serviceResponse = service.listClassifiers(options).execute().getResult().getClassifiers(); RecordedRequest request = server.takeRequest(); String path = PATH_CLASSIFIERS + "?" + VERSION_KEY + "=" + VERSION + "&verbose=true"; assertEquals(path, request.getPath()); assertEquals("GET", request.getMethod()); assertEquals(serviceResponse, classifiers); }