@Test public void get() { when(dashboardConfig.getDashboards()).thenReturn(mockQueryDashboard); when(savedQueryService.getDashboardSearch(savedQuery.getId())).thenReturn(savedQuery); savedQueryController.get(savedQuery.getId()); verify(savedQueryService).getDashboardSearch(savedQuery.getId()); }
@RequestMapping(method = RequestMethod.GET, value = "/{id}") public SavedQuery get(@PathVariable("id") final long id) { if(getValidIds().contains(id)) { return Optional.ofNullable(service.getDashboardSearch(id)) .orElseThrow(() -> new IllegalArgumentException("Configured ID " + id + " does not match any known Saved Query")); } else { throw new IllegalArgumentException("Saved Query ID " + id + " is not in the dashboards configuration file"); } }
IdolSavedQueryController extends SavedQueryController<IdolQueryRequest, String, IdolQueryRestrictions, IdolSearchResult, AciErrorException> { @RequestMapping(method = RequestMethod.GET, value = "/{id}") public SavedQuery get(@PathVariable("id") final long id) { if(getValidIds().contains(id)) { return Optional.ofNullable(service.getDashboardSearch(id)) .orElseThrow(() -> new IllegalArgumentException("Configured ID " + id + " does not match any known Saved Query")); } else { throw new IllegalArgumentException("Saved Query ID " + id + " is not in the dashboards configuration file"); } } }
IdolSavedQueryController extends SavedQueryController<IdolQueryRequest, String, IdolQueryRestrictions, IdolSearchResult, AciErrorException> { @RequestMapping(method = RequestMethod.GET, value = "/{id}") public SavedQuery get(@PathVariable("id") final long id) { if(getValidIds().contains(id)) { return Optional.ofNullable(service.getDashboardSearch(id)) .orElseThrow(() -> new IllegalArgumentException("Configured ID " + id + " does not match any known Saved Query")); } else { throw new IllegalArgumentException("Saved Query ID " + id + " is not in the dashboards configuration file"); } } @SuppressWarnings({"TypeMayBeWeakened", "ConstructorWithTooManyParameters"}) @Autowired  IdolSavedQueryController(final SavedSearchService<SavedQuery, Builder> service,
                             final IdolDocumentsService documentsService,
                             final FieldTextParser fieldTextParser,
                             final ObjectFactory<IdolQueryRestrictionsBuilder> queryRestrictionsBuilderFactory,
                             final ObjectFactory<IdolQueryRequestBuilder> queryRequestBuilderFactory,
                             final ConfigService<DashboardConfig> dashboardConfigService); }
IdolSavedQueryController extends SavedQueryController<IdolQueryRequest, String, IdolQueryRestrictions, IdolSearchResult, AciErrorException> { @RequestMapping(method = RequestMethod.GET, value = "/{id}") public SavedQuery get(@PathVariable("id") final long id) { if(getValidIds().contains(id)) { return Optional.ofNullable(service.getDashboardSearch(id)) .orElseThrow(() -> new IllegalArgumentException("Configured ID " + id + " does not match any known Saved Query")); } else { throw new IllegalArgumentException("Saved Query ID " + id + " is not in the dashboards configuration file"); } } @SuppressWarnings({"TypeMayBeWeakened", "ConstructorWithTooManyParameters"}) @Autowired  IdolSavedQueryController(final SavedSearchService<SavedQuery, Builder> service,
                             final IdolDocumentsService documentsService,
                             final FieldTextParser fieldTextParser,
                             final ObjectFactory<IdolQueryRestrictionsBuilder> queryRestrictionsBuilderFactory,
                             final ObjectFactory<IdolQueryRequestBuilder> queryRequestBuilderFactory,
                             final ConfigService<DashboardConfig> dashboardConfigService); @RequestMapping(method = RequestMethod.GET, value = "/{id}") SavedQuery get(@PathVariable("id") final long id); }
IdolSavedQueryController extends SavedQueryController<IdolQueryRequest, String, IdolQueryRestrictions, IdolSearchResult, AciErrorException> { @RequestMapping(method = RequestMethod.GET, value = "/{id}") public SavedQuery get(@PathVariable("id") final long id) { if(getValidIds().contains(id)) { return Optional.ofNullable(service.getDashboardSearch(id)) .orElseThrow(() -> new IllegalArgumentException("Configured ID " + id + " does not match any known Saved Query")); } else { throw new IllegalArgumentException("Saved Query ID " + id + " is not in the dashboards configuration file"); } } @SuppressWarnings({"TypeMayBeWeakened", "ConstructorWithTooManyParameters"}) @Autowired  IdolSavedQueryController(final SavedSearchService<SavedQuery, Builder> service,
                             final IdolDocumentsService documentsService,
                             final FieldTextParser fieldTextParser,
                             final ObjectFactory<IdolQueryRestrictionsBuilder> queryRestrictionsBuilderFactory,
                             final ObjectFactory<IdolQueryRequestBuilder> queryRequestBuilderFactory,
                             final ConfigService<DashboardConfig> dashboardConfigService); @RequestMapping(method = RequestMethod.GET, value = "/{id}") SavedQuery get(@PathVariable("id") final long id);  }