use of org.finra.herd.model.api.xml.SearchIndexKey in project herd by FINRAOS.
the class SearchIndexValidationServiceTest method testCreateSearchIndexValidationTags.
@Test
public void testCreateSearchIndexValidationTags() {
// Create a search index key.
SearchIndexKey searchIndexKey = new SearchIndexKey(SEARCH_INDEX_NAME);
// Get the search index type value.
String searchIndexType = SearchIndexTypeEntity.SearchIndexTypes.TAG.name();
// Create a search index create request.
SearchIndexValidationCreateRequest searchIndexValidationCreateRequest = new SearchIndexValidationCreateRequest(searchIndexKey, NO_PERFORM_FULL_SEARCH_INDEX_VALIDATION);
searchIndexValidation(searchIndexKey, searchIndexValidationCreateRequest, searchIndexType);
}
use of org.finra.herd.model.api.xml.SearchIndexKey in project herd by FINRAOS.
the class SearchIndexValidationServiceTest method testCreateSearchIndexValidationBusinessObjectDefinitionsFull.
@Test
public void testCreateSearchIndexValidationBusinessObjectDefinitionsFull() {
// Create a search index key.
SearchIndexKey searchIndexKey = new SearchIndexKey(SEARCH_INDEX_NAME);
// Get the search index type value.
String searchIndexType = SearchIndexTypeEntity.SearchIndexTypes.BUS_OBJCT_DFNTN.name();
// Create a search index create request.
SearchIndexValidationCreateRequest searchIndexValidationCreateRequest = new SearchIndexValidationCreateRequest(searchIndexKey, PERFORM_FULL_SEARCH_INDEX_VALIDATION);
searchIndexValidation(searchIndexKey, searchIndexValidationCreateRequest, searchIndexType);
}
use of org.finra.herd.model.api.xml.SearchIndexKey in project herd by FINRAOS.
the class SearchIndexValidationServiceTest method testCreateSearchIndexValidationBusinessObjectDefinitions.
@Test
public void testCreateSearchIndexValidationBusinessObjectDefinitions() {
// Create a search index key.
SearchIndexKey searchIndexKey = new SearchIndexKey(SEARCH_INDEX_NAME);
// Get the search index type value.
String searchIndexType = SearchIndexTypeEntity.SearchIndexTypes.BUS_OBJCT_DFNTN.name();
// Create a search index create request.
SearchIndexValidationCreateRequest searchIndexValidationCreateRequest = new SearchIndexValidationCreateRequest(searchIndexKey, NO_PERFORM_FULL_SEARCH_INDEX_VALIDATION);
searchIndexValidation(searchIndexKey, searchIndexValidationCreateRequest, searchIndexType);
}
use of org.finra.herd.model.api.xml.SearchIndexKey in project herd by FINRAOS.
the class SearchIndexValidationServiceTest method testCreateSearchIndexValidationTagsFull.
@Test
public void testCreateSearchIndexValidationTagsFull() {
// Create a search index key.
SearchIndexKey searchIndexKey = new SearchIndexKey(SEARCH_INDEX_NAME);
// Get the search index type value.
String searchIndexType = SearchIndexTypeEntity.SearchIndexTypes.TAG.name();
// Create a search index create request.
SearchIndexValidationCreateRequest searchIndexValidationCreateRequest = new SearchIndexValidationCreateRequest(searchIndexKey, PERFORM_FULL_SEARCH_INDEX_VALIDATION);
searchIndexValidation(searchIndexKey, searchIndexValidationCreateRequest, searchIndexType);
}
use of org.finra.herd.model.api.xml.SearchIndexKey in project herd by FINRAOS.
the class SearchIndexServiceImplTest method testCreateSearchIndexHelper.
@Test
public void testCreateSearchIndexHelper() {
// Create a search index key.
SearchIndexKey searchIndexKey = new SearchIndexKey(SEARCH_INDEX_NAME);
// Get the search index type value.
String searchIndexType = SearchIndexTypeEntity.SearchIndexTypes.BUS_OBJCT_DFNTN.name();
// Mock some of the external call responses.
@SuppressWarnings("unchecked") Future<Void> mockedFuture = mock(Future.class);
// Mock the external calls.
when(configurationHelper.getProperty(ConfigurationValue.ELASTICSEARCH_BDEF_DOCUMENT_TYPE, String.class)).thenReturn(SEARCH_INDEX_DOCUMENT_TYPE);
when(configurationHelper.getProperty(ConfigurationValue.ELASTICSEARCH_BDEF_INDEX_NAME, String.class)).thenReturn(SEARCH_INDEX_ALIAS_BDEF);
when(configurationDaoHelper.getClobProperty(ConfigurationValue.ELASTICSEARCH_BDEF_MAPPINGS_JSON.getKey())).thenReturn(SEARCH_INDEX_MAPPING);
when(configurationDaoHelper.getClobProperty(ConfigurationValue.ELASTICSEARCH_BDEF_SETTINGS_JSON.getKey())).thenReturn(SEARCH_INDEX_SETTINGS);
when(searchIndexHelperService.indexAllBusinessObjectDefinitions(searchIndexKey, SEARCH_INDEX_DOCUMENT_TYPE)).thenReturn(mockedFuture);
// Create a search index.
searchIndexServiceImpl.createSearchIndexHelper(searchIndexKey, searchIndexType);
// Verify the external calls.
verify(configurationHelper).getProperty(ConfigurationValue.ELASTICSEARCH_BDEF_DOCUMENT_TYPE, String.class);
verify(configurationHelper).getProperty(ConfigurationValue.ELASTICSEARCH_BDEF_INDEX_NAME, String.class);
verify(configurationDaoHelper).getClobProperty(ConfigurationValue.ELASTICSEARCH_BDEF_MAPPINGS_JSON.getKey());
verify(configurationDaoHelper).getClobProperty(ConfigurationValue.ELASTICSEARCH_BDEF_SETTINGS_JSON.getKey());
verify(indexFunctionDao).createIndex(any(), any(), any(), any(), any());
verify(searchIndexHelperService).indexAllBusinessObjectDefinitions(searchIndexKey, SEARCH_INDEX_DOCUMENT_TYPE);
verifyNoMoreInteractions(alternateKeyHelper, businessObjectDefinitionDao, businessObjectDefinitionHelper, configurationDaoHelper, indexFunctionDao, searchIndexDao, searchIndexDaoHelper, searchIndexHelperService, searchIndexStatusDaoHelper, searchIndexTypeDaoHelper);
}
Aggregations