Skip to content

Commit

Permalink
fix remaining metadata-io test i forgot about
Browse files Browse the repository at this point in the history
  • Loading branch information
chriscollins3456 committed Dec 11, 2024
1 parent 5064172 commit b51804f
Showing 1 changed file with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1124,9 +1124,10 @@ public void testFacets() {
@Test
public void testNestedAggregation() {
Set<String> 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 -> {
Expand All @@ -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 -> {
Expand Down Expand Up @@ -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 -> {
Expand Down Expand Up @@ -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<String, Long> expectedNestedFacetCounts = new HashMap<>();
expectedNestedFacetCounts.put("datajob␞urn:li:corpuser:datahub", 2L);
Expand All @@ -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 -> {
Expand Down

0 comments on commit b51804f

Please sign in to comment.