Search in sources :

Example 1 with SearchIndexKeys

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);
}
Also used : SearchIndexKeys(org.finra.herd.model.api.xml.SearchIndexKeys) SearchIndexKey(org.finra.herd.model.api.xml.SearchIndexKey) Test(org.junit.Test)

Example 2 with SearchIndexKeys

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;
}
Also used : SearchIndexKeys(org.finra.herd.model.api.xml.SearchIndexKeys)

Example 3 with 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);
}
Also used : SearchIndexKey(org.finra.herd.model.api.xml.SearchIndexKey) SearchIndexKeys(org.finra.herd.model.api.xml.SearchIndexKeys) Test(org.junit.Test)

Aggregations

SearchIndexKeys (org.finra.herd.model.api.xml.SearchIndexKeys)3 SearchIndexKey (org.finra.herd.model.api.xml.SearchIndexKey)2 Test (org.junit.Test)2