diff --git a/metadata-io/src/test/java/com/linkedin/metadata/search/fixtures/SampleDataFixtureTestBase.java b/metadata-io/src/test/java/com/linkedin/metadata/search/fixtures/SampleDataFixtureTestBase.java index fd663de40e0050..476f0114817be1 100644 --- a/metadata-io/src/test/java/com/linkedin/metadata/search/fixtures/SampleDataFixtureTestBase.java +++ b/metadata-io/src/test/java/com/linkedin/metadata/search/fixtures/SampleDataFixtureTestBase.java @@ -1124,9 +1124,10 @@ public void testFacets() { @Test public void testNestedAggregation() { Set expectedFacets = Set.of("platform"); + OperationContext context = + getOperationContext().withSearchFlags(flags -> flags.setIncludeDefaultFacets(false)); SearchResult testResult = - facetAcrossEntities( - getOperationContext(), getSearchService(), "cypress", List.copyOf(expectedFacets)); + facetAcrossEntities(context, getSearchService(), "cypress", List.copyOf(expectedFacets)); assertEquals(testResult.getMetadata().getAggregations().size(), 1); expectedFacets.forEach( facet -> { @@ -1143,8 +1144,7 @@ public void testNestedAggregation() { expectedFacets = Set.of("platform", "typeNames", "_entityType", "entity"); SearchResult testResult2 = - facetAcrossEntities( - getOperationContext(), getSearchService(), "cypress", List.copyOf(expectedFacets)); + facetAcrossEntities(context, getSearchService(), "cypress", List.copyOf(expectedFacets)); assertEquals(testResult2.getMetadata().getAggregations().size(), 4); expectedFacets.forEach( facet -> { @@ -1191,8 +1191,7 @@ public void testNestedAggregation() { expectedFacets = Set.of("platform", "typeNames", "entity"); SearchResult testResult3 = - facetAcrossEntities( - getOperationContext(), getSearchService(), "cypress", List.copyOf(expectedFacets)); + facetAcrossEntities(context, getSearchService(), "cypress", List.copyOf(expectedFacets)); assertEquals(testResult3.getMetadata().getAggregations().size(), 4); expectedFacets.forEach( facet -> { @@ -1222,8 +1221,7 @@ public void testNestedAggregation() { String singleNestedFacet = String.format("_entityType%sowners", AGGREGATION_SEPARATOR_CHAR); expectedFacets = Set.of(singleNestedFacet); SearchResult testResultSingleNested = - facetAcrossEntities( - getOperationContext(), getSearchService(), "cypress", List.copyOf(expectedFacets)); + facetAcrossEntities(context, getSearchService(), "cypress", List.copyOf(expectedFacets)); assertEquals(testResultSingleNested.getMetadata().getAggregations().size(), 1); Map expectedNestedFacetCounts = new HashMap<>(); expectedNestedFacetCounts.put("datajobāžurn:li:corpuser:datahub", 2L); @@ -1245,8 +1243,7 @@ public void testNestedAggregation() { expectedFacets = Set.of("platform", singleNestedFacet, "typeNames", "origin"); SearchResult testResultNested = - facetAcrossEntities( - getOperationContext(), getSearchService(), "cypress", List.copyOf(expectedFacets)); + facetAcrossEntities(context, getSearchService(), "cypress", List.copyOf(expectedFacets)); assertEquals(testResultNested.getMetadata().getAggregations().size(), 4); expectedFacets.forEach( facet -> {