AnswerServerController { @RequestMapping(value = ASK_PATH, method = RequestMethod.GET) public List<AskAnswer> ask(@RequestParam(TEXT_PARAM) final String text, @RequestParam(value = FIELDTEXT_PARAM, required = false) final String fieldText, @RequestParam(value = MAX_RESULTS_PARAM, required = false) final Integer maxResults) { final AskAnswerServerRequest request = requestBuilderFactory.getObject() .text(text) .maxResults(maxResults) .proxiedParams(StringUtils.isBlank(fieldText) ? Collections.emptyMap() : Collections.singletonMap("fieldtext", fieldText)) .systemNames(configService.getConfig().getAnswerServer().getSystemNames()) .build(); return askAnswerServerService.ask(request); } @Autowired  AnswerServerController(
        final AciService aciService,
        final AskAnswerServerService askAnswerServerService,
        final ObjectFactory<AskAnswerServerRequestBuilder> requestBuilderFactory,
        final ConfigService<IdolFindConfig> configService,
        final ProcessorFactory processorFactory,
        final DocumentsService<IdolQueryRequest, ?, ?, IdolQueryRestrictions, IdolSearchResult, AciErrorException> documentsService,
        final org.springframework.beans.factory.ObjectFactory<? extends QueryRestrictionsBuilder<IdolQueryRestrictions, String, ?>> queryRestrictionsBuilderFactory,
        final ObjectFactory<? extends QueryRequestBuilder<IdolQueryRequest, IdolQueryRestrictions, ?>> queryRequestBuilderFactory
    ); @RequestMapping(value = ASK_PATH, method = RequestMethod.GET) List<AskAnswer> ask(@RequestParam(TEXT_PARAM)
                               final String text,
                               @RequestParam(value = FIELDTEXT_PARAM, required = false)
                               final String fieldText,
                               @RequestParam(value = MAX_RESULTS_PARAM, required = false)
                               final Integer maxResults); @RequestMapping(value = "entity-facts", method = RequestMethod.GET) List<SourcedFact> getEntityFacts(
        @RequestParam(ENTITY_PARAM) final String entity,
        @RequestParam(value = MAX_RESULTS_PARAM, required = false) final Integer maxResults,
        @RequestParam(INDEXES_PARAM) final Collection<String> databases
    );  }
@Test public void ask() { controller.ask("GPU", null,5); verify(askAnswerServerService).ask(any()); }