SearchIndexValidationRestController extends HerdBaseController { @RequestMapping(value = SEARCH_INDEX_VALIDATION_URI_PREFIX, method = RequestMethod.POST, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_SEARCH_INDEXES_VALIDATION_POST) public SearchIndexValidation createSearchIndexValidation(@RequestBody SearchIndexValidationCreateRequest request) { return searchIndexValidationService.createSearchIndexValidation(request); }  @RequestMapping(value = SEARCH_INDEX_VALIDATION_URI_PREFIX, method = RequestMethod.POST, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_SEARCH_INDEXES_VALIDATION_POST) SearchIndexValidation createSearchIndexValidation(@RequestBody SearchIndexValidationCreateRequest request); static final String SEARCH_INDEX_VALIDATION_URI_PREFIX; }
@Test public void testCreateSearchIndexValidation() { SearchIndexValidationCreateRequest searchIndexValidationCreateRequest = new SearchIndexValidationCreateRequest(new SearchIndexKey(SEARCH_INDEX_NAME), PERFORM_FULL_SEARCH_INDEX_VALIDATION); SearchIndexValidation searchIndexValidation = new SearchIndexValidation(new SearchIndexKey(SEARCH_INDEX_NAME), SEARCH_INDEX_STATISTICS_CREATION_DATE, false, false, false); when(searchIndexValidationService.createSearchIndexValidation(searchIndexValidationCreateRequest)).thenReturn(searchIndexValidation); SearchIndexValidation response = searchIndexValidationRestController.createSearchIndexValidation(searchIndexValidationCreateRequest); verify(searchIndexValidationService, times(1)).createSearchIndexValidation(searchIndexValidationCreateRequest); response.setValidateStartTime(SEARCH_INDEX_STATISTICS_CREATION_DATE); assertEquals(searchIndexValidation, response); }