SearchIndexActivationRestController extends HerdBaseController { @RequestMapping(value = SEARCH_INDEX_ACTIVATION_URI_PREFIX, method = RequestMethod.POST, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_SEARCH_INDEXES_ACTIVATION_POST) public SearchIndexActivation createSearchIndexActivation(@RequestBody SearchIndexActivationCreateRequest request) { return searchIndexActivationService.createSearchIndexActivation(request); }  @RequestMapping(value = SEARCH_INDEX_ACTIVATION_URI_PREFIX, method = RequestMethod.POST, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_SEARCH_INDEXES_ACTIVATION_POST) SearchIndexActivation createSearchIndexActivation(@RequestBody SearchIndexActivationCreateRequest request); static final String SEARCH_INDEX_ACTIVATION_URI_PREFIX; }
@Test public void testCreateSearchIndexActivation() { SearchIndexActivationCreateRequest searchIndexActivationCreateRequest = new SearchIndexActivationCreateRequest(new SearchIndexKey(SEARCH_INDEX_NAME)); SearchIndexActivation searchIndexActivation = new SearchIndexActivation(new SearchIndexKey(SEARCH_INDEX_NAME), SEARCH_INDEX_TYPE, SEARCH_INDEX_STATUS, SEARCH_INDEX_ACTIVE_FLAG, CREATED_BY, CREATED_ON, UPDATED_ON); when(searchIndexActivationService.createSearchIndexActivation(searchIndexActivationCreateRequest)).thenReturn(searchIndexActivation); SearchIndexActivation response = searchIndexActivationRestController.createSearchIndexActivation(searchIndexActivationCreateRequest); verify(searchIndexActivationService, times(1)).createSearchIndexActivation(searchIndexActivationCreateRequest); assertEquals(searchIndexActivation, response); }