Discovery extends BaseService { public ServiceCall<TrainingQuery> getTrainingQuery( GetTrainingQueryOptions getTrainingQueryOptions) { com.ibm.cloud.sdk.core.util.Validator.notNull( getTrainingQueryOptions, "getTrainingQueryOptions cannot be null"); String[] pathSegments = {"v2/projects", "training_data/queries"}; String[] pathParameters = { getTrainingQueryOptions.projectId(), getTrainingQueryOptions.queryId() }; RequestBuilder builder = RequestBuilder.get( RequestBuilder.constructHttpUrl(getServiceUrl(), pathSegments, pathParameters)); builder.query("version", versionDate); Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("discovery", "v2", "getTrainingQuery"); for (Entry<String, String> header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); ResponseConverter<TrainingQuery> responseConverter = ResponseConverterUtils.getValue( new com.google.gson.reflect.TypeToken<TrainingQuery>() {}.getType()); return createServiceCall(builder.build(), responseConverter); } Discovery(String versionDate);  Discovery(String versionDate, Authenticator authenticator);  Discovery(String versionDate, String serviceName);  Discovery(String versionDate, String serviceName, Authenticator authenticator); ServiceCall<ListCollectionsResponse> listCollections(
      ListCollectionsOptions listCollectionsOptions); ServiceCall<CollectionDetails> createCollection(
      CreateCollectionOptions createCollectionOptions); ServiceCall<CollectionDetails> getCollection(GetCollectionOptions getCollectionOptions); ServiceCall<CollectionDetails> updateCollection(
      UpdateCollectionOptions updateCollectionOptions); ServiceCall<Void> deleteCollection(DeleteCollectionOptions deleteCollectionOptions); ServiceCall<QueryResponse> query(QueryOptions queryOptions); ServiceCall<Completions> getAutocompletion(
      GetAutocompletionOptions getAutocompletionOptions); ServiceCall<QueryNoticesResponse> queryNotices(QueryNoticesOptions queryNoticesOptions); ServiceCall<ListFieldsResponse> listFields(ListFieldsOptions listFieldsOptions); ServiceCall<ComponentSettingsResponse> getComponentSettings(
      GetComponentSettingsOptions getComponentSettingsOptions); ServiceCall<DocumentAccepted> addDocument(AddDocumentOptions addDocumentOptions); ServiceCall<DocumentAccepted> updateDocument(UpdateDocumentOptions updateDocumentOptions); ServiceCall<DeleteDocumentResponse> deleteDocument(
      DeleteDocumentOptions deleteDocumentOptions); ServiceCall<TrainingQuerySet> listTrainingQueries(
      ListTrainingQueriesOptions listTrainingQueriesOptions); ServiceCall<Void> deleteTrainingQueries(
      DeleteTrainingQueriesOptions deleteTrainingQueriesOptions); ServiceCall<TrainingQuery> createTrainingQuery(
      CreateTrainingQueryOptions createTrainingQueryOptions); ServiceCall<TrainingQuery> getTrainingQuery(
      GetTrainingQueryOptions getTrainingQueryOptions); ServiceCall<TrainingQuery> updateTrainingQuery(
      UpdateTrainingQueryOptions updateTrainingQueryOptions); ServiceCall<Enrichments> listEnrichments(ListEnrichmentsOptions listEnrichmentsOptions); ServiceCall<Enrichment> createEnrichment(CreateEnrichmentOptions createEnrichmentOptions); ServiceCall<Enrichment> getEnrichment(GetEnrichmentOptions getEnrichmentOptions); ServiceCall<Enrichment> updateEnrichment(UpdateEnrichmentOptions updateEnrichmentOptions); ServiceCall<Void> deleteEnrichment(DeleteEnrichmentOptions deleteEnrichmentOptions); ServiceCall<ListProjectsResponse> listProjects(ListProjectsOptions listProjectsOptions); ServiceCall<ListProjectsResponse> listProjects(); ServiceCall<ProjectDetails> createProject(CreateProjectOptions createProjectOptions); ServiceCall<ProjectDetails> getProject(GetProjectOptions getProjectOptions); ServiceCall<ProjectDetails> updateProject(UpdateProjectOptions updateProjectOptions); ServiceCall<Void> deleteProject(DeleteProjectOptions deleteProjectOptions); ServiceCall<Void> deleteUserData(DeleteUserDataOptions deleteUserDataOptions);  }
@Test public void testGetTrainingQuery() { server.enqueue(jsonResponse(trainingQuery)); GetTrainingQueryOptions options = new GetTrainingQueryOptions.Builder().projectId(PROJECT_ID).queryId(QUERY_ID).build(); TrainingQuery response = service.getTrainingQuery(options).execute().getResult(); assertEquals(QUERY_ID, response.queryId()); assertEquals(NATURAL_LANGUAGE_QUERY, response.naturalLanguageQuery()); assertEquals(FILTER, response.filter()); assertEquals(testDate, response.created()); assertEquals(testDate, response.updated()); assertEquals(DOCUMENT_ID, response.examples().get(0).documentId()); assertEquals(COLLECTION_ID, response.examples().get(0).collectionId()); assertEquals(RELEVANCE, response.examples().get(0).relevance()); assertEquals(testDate, response.examples().get(0).created()); assertEquals(testDate, response.examples().get(0).updated()); }