Search in sources :

Example 26 with SearchIndexEntity

use of org.finra.herd.model.jpa.SearchIndexEntity in project herd by FINRAOS.

the class SearchIndexDaoHelperTest method testUpdateSearchIndexStatus.

@Test
public void testUpdateSearchIndexStatus() {
    // Create and persist a search index entity.
    SearchIndexEntity searchIndexEntity = searchIndexDaoTestHelper.createSearchIndexEntity(SEARCH_INDEX_NAME, SEARCH_INDEX_TYPE, SEARCH_INDEX_STATUS);
    // Create and persist a search index status entity.
    searchIndexStatusDaoTestHelper.createSearchIndexStatusEntity(SEARCH_INDEX_STATUS_2);
    // Update the status of the search index entity.
    searchIndexDaoHelper.updateSearchIndexStatus(new SearchIndexKey(SEARCH_INDEX_NAME), SEARCH_INDEX_STATUS_2);
    // Validate the results.
    assertEquals(SEARCH_INDEX_STATUS_2, searchIndexEntity.getStatus().getCode());
}
Also used : SearchIndexKey(org.finra.herd.model.api.xml.SearchIndexKey) SearchIndexEntity(org.finra.herd.model.jpa.SearchIndexEntity) Test(org.junit.Test) AbstractServiceTest(org.finra.herd.service.AbstractServiceTest)

Aggregations

SearchIndexEntity (org.finra.herd.model.jpa.SearchIndexEntity)26 Test (org.junit.Test)12 SearchIndexKey (org.finra.herd.model.api.xml.SearchIndexKey)11 SearchIndexTypeEntity (org.finra.herd.model.jpa.SearchIndexTypeEntity)8 SearchIndex (org.finra.herd.model.api.xml.SearchIndex)7 SearchIndexStatusEntity (org.finra.herd.model.jpa.SearchIndexStatusEntity)7 AbstractServiceTest (org.finra.herd.service.AbstractServiceTest)6 Timestamp (java.sql.Timestamp)4 CriteriaBuilder (javax.persistence.criteria.CriteriaBuilder)3 Predicate (javax.persistence.criteria.Predicate)2 Settings (org.elasticsearch.common.settings.Settings)2 DocsStats (org.elasticsearch.index.shard.DocsStats)2 ObjectNotFoundException (org.finra.herd.model.ObjectNotFoundException)2 SearchIndexActivation (org.finra.herd.model.api.xml.SearchIndexActivation)2 SearchIndexCreateRequest (org.finra.herd.model.api.xml.SearchIndexCreateRequest)2 SearchIndexValidation (org.finra.herd.model.api.xml.SearchIndexValidation)2 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1 HashMap (java.util.HashMap)1 SearchIndexActivationCreateRequest (org.finra.herd.model.api.xml.SearchIndexActivationCreateRequest)1