Search in sources :

Example 26 with EsQueueDto

use of org.sonar.db.es.EsQueueDto in project sonarqube by SonarSource.

the class RecoveryIndexerTest method recent_records_are_not_recovered.

@Test
public void recent_records_are_not_recovered() {
    EsQueueDto item = insertItem(FOO_TYPE, "f1");
    SuccessfulFakeIndexer indexer = new SuccessfulFakeIndexer(FOO_TYPE);
    // do not advance in time
    underTest = newRecoveryIndexer(indexer);
    underTest.recover();
    assertThatQueueHasSize(1);
    assertThat(indexer.called).isEmpty();
    assertThatLogsDoNotContain(TRACE, "Elasticsearch recovery - processing 2 [foos/foo]");
    assertThatLogsDoNotContain(INFO, "documents processed");
}
Also used : EsQueueDto(org.sonar.db.es.EsQueueDto) Test(org.junit.Test)

Aggregations

EsQueueDto (org.sonar.db.es.EsQueueDto)26 Test (org.junit.Test)13 DbSession (org.sonar.db.DbSession)7 IndexingResult (org.sonar.server.es.IndexingResult)6 HashMap (java.util.HashMap)3 BulkIndexer (org.sonar.server.es.BulkIndexer)3 VisibleForTesting (com.google.common.annotations.VisibleForTesting)2 Arrays (java.util.Arrays)2 Collection (java.util.Collection)2 Collections.emptyList (java.util.Collections.emptyList)2 List (java.util.List)2 Map (java.util.Map)2 Collectors (java.util.stream.Collectors)2 ComponentDto (org.sonar.db.component.ComponentDto)2 OneToOneResilientIndexingListener (org.sonar.server.es.OneToOneResilientIndexingListener)2 ProjectIndexer (org.sonar.server.es.ProjectIndexer)2 ImmutableSet (com.google.common.collect.ImmutableSet)1 Arrays.asList (java.util.Arrays.asList)1 Collections.emptySet (java.util.Collections.emptySet)1 Collections.singletonList (java.util.Collections.singletonList)1