Skip to content

Commit

Permalink
HSEARCH-2194 Test nested @IndexedEmbeddeds where only the second leve…
Browse files Browse the repository at this point in the history
…l applies an includePaths filter

Not sure it makes sense in Search 6, since I suspect the bug was
completely caused by the older algorithm from Search 5, but I guess one
more test doesn't hurt.
  • Loading branch information
yrodiere committed Sep 24, 2018
1 parent 06a8a0b commit d4cf581
Showing 1 changed file with 23 additions and 0 deletions.
Expand Up @@ -20,6 +20,8 @@
import org.hibernate.search.engine.backend.document.model.dsl.impl.IndexSchemaNestingContext;
import org.hibernate.search.engine.mapper.model.spi.MappableTypeModel;
import org.hibernate.search.util.SearchException;
import org.hibernate.search.util.impl.common.CollectionHelper;
import org.hibernate.search.util.impl.test.annotation.TestForIssue;

import org.junit.Rule;
import org.junit.Test;
Expand Down Expand Up @@ -260,6 +262,27 @@ public void indexedEmbedded_includePaths() {
checkCompositeExcluded( "level3", level2Context, "level3" );
}

@Test
@TestForIssue(jiraKey = "HSEARCH-2194")
public void indexedEmbedded_noFilterThenIncludePaths() {
IndexSchemaNestingContextImpl rootContext = IndexSchemaNestingContextImpl.root();

// First level of @IndexedEmbedded: no filter
IndexSchemaNestingContextImpl level1Context = checkSimpleIndexedEmbeddedIncluded(
"professionnelGC", rootContext, typeModel1Mock, "professionnelGC.",
null, null
);

// Second level of @IndexedEmbedded: includePaths filter
IndexSchemaNestingContextImpl level2Context = checkSimpleIndexedEmbeddedIncluded(
"groupe", level1Context, typeModel1Mock, "groupe.",
null, CollectionHelper.asSet( "raisonSociale" )
);

checkLeafIncluded( "raisonSociale", level2Context, "raisonSociale" );
checkLeafExcluded( "notRaisonSociale", level2Context, "notRaisonSociale" );
}

@Test
public void indexedEmbedded_depth0() {
IndexSchemaNestingContextImpl rootContext = IndexSchemaNestingContextImpl.root();
Expand Down

0 comments on commit d4cf581

Please sign in to comment.