use of org.finra.herd.model.api.xml.SearchIndexKeys in project herd by FINRAOS.
the class SearchIndexRestControllerTest method testGetSearchIndexes.
@Test
public void testGetSearchIndexes() {
// Create a get search indexes response.
SearchIndexKeys searchIndexKeys = new SearchIndexKeys(Arrays.asList(new SearchIndexKey(SEARCH_INDEX_NAME), new SearchIndexKey(SEARCH_INDEX_NAME_2)));
// Mock the call to the search index service.
when(searchIndexService.getSearchIndexes()).thenReturn(searchIndexKeys);
// Get search indexes.
SearchIndexKeys response = searchIndexRestController.getSearchIndexes();
// Verify the calls.
verify(searchIndexService, times(1)).getSearchIndexes();
// Validate the returned object.
assertEquals(searchIndexKeys, response);
}
use of org.finra.herd.model.api.xml.SearchIndexKeys in project herd by FINRAOS.
the class SearchIndexServiceImpl method getSearchIndexes.
@Override
public SearchIndexKeys getSearchIndexes() {
SearchIndexKeys searchIndexKeys = new SearchIndexKeys();
searchIndexKeys.getSearchIndexKeys().addAll(searchIndexDao.getSearchIndexes());
return searchIndexKeys;
}
use of org.finra.herd.model.api.xml.SearchIndexKeys in project herd by FINRAOS.
the class SearchIndexServiceTest method testGetSearchIndexes.
@Test
public void testGetSearchIndexes() {
// Create a list of search index keys.
List<SearchIndexKey> searchIndexKeys = Arrays.asList(new SearchIndexKey(SEARCH_INDEX_NAME), new SearchIndexKey(SEARCH_INDEX_NAME_2));
// Mock the external calls.
when(searchIndexDao.getSearchIndexes()).thenReturn(searchIndexKeys);
// Get search indexes.
SearchIndexKeys response = searchIndexService.getSearchIndexes();
// Verify the external calls.
verify(searchIndexDao).getSearchIndexes();
verifyNoMoreInteractions(alternateKeyHelper, businessObjectDefinitionDao, businessObjectDefinitionHelper, configurationDaoHelper, configurationHelper, indexFunctionsDao, searchIndexDao, searchIndexDaoHelper, searchIndexHelperService, searchIndexStatusDaoHelper, searchIndexTypeDaoHelper);
// Validate the returned object.
assertEquals(new SearchIndexKeys(searchIndexKeys), response);
}
Aggregations