diff --git a/server/src/test/java/org/opensearch/search/SearchServiceStarTreeTests.java b/server/src/test/java/org/opensearch/search/SearchServiceStarTreeTests.java index f646b6b063ed0..0c88154ca2b38 100644 --- a/server/src/test/java/org/opensearch/search/SearchServiceStarTreeTests.java +++ b/server/src/test/java/org/opensearch/search/SearchServiceStarTreeTests.java @@ -141,8 +141,6 @@ private void assertStarTreeContext( SearchContext context = searchService.createContext(reader, request, null, true); StarTreeQueryContext actualContext = context.getStarTreeQueryContext(); - - if (expectedContext == null) { assertThat(context.getStarTreeQueryContext(), nullValue()); } else { diff --git a/server/src/test/java/org/opensearch/search/aggregations/startree/StarTreeQueryContextTests.java b/server/src/test/java/org/opensearch/search/aggregations/startree/StarTreeQueryContextTests.java index 076473d2c6a2a..3d4b4719a09fa 100644 --- a/server/src/test/java/org/opensearch/search/aggregations/startree/StarTreeQueryContextTests.java +++ b/server/src/test/java/org/opensearch/search/aggregations/startree/StarTreeQueryContextTests.java @@ -10,11 +10,10 @@ import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.util.FixedBitSet; -import org.junit.Before; -import org.junit.Test; import org.opensearch.index.codec.composite.CompositeIndexFieldInfo; import org.opensearch.search.startree.StarTreeQueryContext; import org.opensearch.test.OpenSearchTestCase; +import org.junit.Before; import java.util.HashMap; import java.util.Map; @@ -47,7 +46,6 @@ public void setUp() { when(mockLeafReaderContext.ord).thenReturn(1); } - public void testConstructorWithValidNumSegmentsCache() { // Initialize context with valid numSegmentsCache int numSegmentsCache = 3; @@ -62,7 +60,6 @@ public void testConstructorWithValidNumSegmentsCache() { assertEquals(numSegmentsCache, context.getStarTreeValues().length); } - public void testConstructorWithNegativeNumSegmentsCache() { // Initialize context with invalid numSegmentsCache (-1) context = new StarTreeQueryContext(mockStarTree, queryMap, -1); @@ -71,7 +68,6 @@ public void testConstructorWithNegativeNumSegmentsCache() { assertNull(context.getStarTreeValues()); } - public void testGetStarTreeValues_WithValidContext() { // Initialize context with a cache of size 3 context = new StarTreeQueryContext(mockStarTree, queryMap, 3); @@ -88,7 +84,6 @@ public void testGetStarTreeValues_WithValidContext() { assertEquals(fixedBitSet, result); } - public void testGetStarTreeValues_WithNullCache() { // Initialize context with no cache (numSegmentsCache is -1) context = new StarTreeQueryContext(mockStarTree, queryMap, -1); @@ -99,7 +94,7 @@ public void testGetStarTreeValues_WithNullCache() { // Verify that the result is null since there's no cache assertNull(result); } - + public void testSetStarTreeValues() { // Initialize context with a cache of size 3 context = new StarTreeQueryContext(mockStarTree, queryMap, 3);