Skip to content

Commit

Permalink
Fixed some more tests
Browse files Browse the repository at this point in the history
Signed-off-by: Norman Jordan <norman.jordan@improving.com>
  • Loading branch information
normanj-bitquill committed Oct 23, 2024
1 parent e93cc5f commit 1fba9ec
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public void setup() {
@Test
void test_protect_indexScan() {
when(settings.getSettingValue(Settings.Key.SQL_PAGINATION_API_SEARCH_AFTER)).thenReturn(true);
when(settings.getSettingValue(Settings.Key.FIELD_TYPE_TOLERANCE)).thenReturn(false);

String indexName = "test";
final int maxResultWindow = 10000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
import org.opensearch.action.search.SearchRequest;
Expand Down Expand Up @@ -72,7 +71,7 @@ public class OpenSearchQueryRequestTest {
@Mock private OpenSearchStorageEngine engine;
@Mock private PointInTimeBuilder pointInTimeBuilder;

@InjectMocks private OpenSearchQueryRequest serializationRequest;
private OpenSearchQueryRequest serializationRequest;

private SearchSourceBuilder sourceBuilderForSerializer;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ void setup() {
lenient()
.when(settings.getSettingValue(Settings.Key.SQL_PAGINATION_API_SEARCH_AFTER))
.thenReturn(true);
lenient().when(settings.getSettingValue(Settings.Key.FIELD_TYPE_TOLERANCE)).thenReturn(false);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ void setUp() {
lenient()
.when(settings.getSettingValue(Settings.Key.SQL_PAGINATION_API_SEARCH_AFTER))
.thenReturn(true);
lenient().when(settings.getSettingValue(Settings.Key.FIELD_TYPE_TOLERANCE)).thenReturn(false);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ void setup() {
lenient()
.when(settings.getSettingValue(Settings.Key.SQL_PAGINATION_API_SEARCH_AFTER))
.thenReturn(true);
lenient().when(settings.getSettingValue(Settings.Key.FIELD_TYPE_TOLERANCE)).thenReturn(false);
}

@Mock private OpenSearchClient client;
Expand Down

0 comments on commit 1fba9ec

Please sign in to comment.