Search in sources :

Example 21 with IndexEntryConflictException

use of org.neo4j.kernel.api.exceptions.index.IndexEntryConflictException in project neo4j by neo4j.

the class FusionIndexPopulatorTest method verifyDeferredConstraintsMustThrowIfAnyThrow.

/* verifyDeferredConstraints */
@Test
void verifyDeferredConstraintsMustThrowIfAnyThrow() throws Exception {
    for (IndexPopulator alivePopulator : alivePopulators) {
        // given
        IndexEntryConflictException failure = mock(IndexEntryConflictException.class);
        doThrow(failure).when(alivePopulator).verifyDeferredConstraints(any());
        verifyCallFail(failure, () -> {
            fusionIndexPopulator.verifyDeferredConstraints(null);
            return null;
        });
        // reset throw for testing of next populator
        doAnswer(invocation -> null).when(alivePopulator).verifyDeferredConstraints(any());
    }
}
Also used : IndexPopulator(org.neo4j.kernel.api.index.IndexPopulator) IndexEntryConflictException(org.neo4j.kernel.api.exceptions.index.IndexEntryConflictException) Test(org.junit.jupiter.api.Test)

Aggregations

IndexEntryConflictException (org.neo4j.kernel.api.exceptions.index.IndexEntryConflictException)21 IOException (java.io.IOException)9 Test (org.junit.jupiter.api.Test)5 IndexDescriptor (org.neo4j.internal.schema.IndexDescriptor)5 UniquePropertyValueValidationException (org.neo4j.kernel.api.exceptions.schema.UniquePropertyValueValidationException)5 TermQuery (org.apache.lucene.search.TermQuery)4 IndexUpdater (org.neo4j.kernel.api.index.IndexUpdater)4 NewIndexDescriptor (org.neo4j.kernel.api.schema_new.index.NewIndexDescriptor)4 ArrayList (java.util.ArrayList)3 Arrays (java.util.Arrays)3 Collection (java.util.Collection)3 List (java.util.List)3 Test (org.junit.Test)3 Collections (java.util.Collections)2 HashMap (java.util.HashMap)2 HashSet (java.util.HashSet)2 Iterator (java.util.Iterator)2 Map (java.util.Map)2 Set (java.util.Set)2 Query (org.apache.lucene.search.Query)2