Skip to content

Commit dc20767

Browse files
committed
Fix Jackson exception handling due to 3.x release line migration
Signed-off-by: Andriy Redko <drreta@gmail.com>
1 parent 3b174ad commit dc20767

File tree

5 files changed

+10
-11
lines changed

5 files changed

+10
-11
lines changed

common/src/main/java/org/opensearch/ml/common/MLCommonsClassLoader.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,9 @@
2626
import org.opensearch.ml.common.exception.MLException;
2727
import org.opensearch.ml.common.output.MLOutput;
2828
import org.opensearch.ml.common.output.MLOutputType;
29+
import org.opensearch.tools.jackson.core.JsonParseException;
2930
import org.reflections.Reflections;
3031

31-
import com.fasterxml.jackson.core.JsonParseException;
32-
3332
import lombok.extern.log4j.Log4j2;
3433

3534
@Log4j2

common/src/test/java/org/opensearch/ml/common/MLCommonsClassLoaderTests.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@
3939
import org.opensearch.ml.common.output.execute.metrics_correlation.MetricsCorrelationOutput;
4040
import org.opensearch.ml.common.output.execute.samplecalculator.LocalSampleCalculatorOutput;
4141
import org.opensearch.search.SearchModule;
42-
43-
import com.fasterxml.jackson.core.JsonParseException;
42+
import org.opensearch.tools.jackson.core.JsonParseException;
4443

4544
public class MLCommonsClassLoaderTests {
4645

common/src/test/java/org/opensearch/ml/common/model/MLDeployingSettingTests.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@
2828
import org.opensearch.core.xcontent.XContentBuilder;
2929
import org.opensearch.core.xcontent.XContentParser;
3030
import org.opensearch.search.SearchModule;
31-
32-
import com.fasterxml.jackson.core.JsonParseException;
31+
import org.opensearch.tools.jackson.core.JsonParseException;
3332

3433
public class MLDeployingSettingTests {
3534

search-processors/src/test/java/org/opensearch/searchpipelines/questionanswering/generative/GenerativeSearchResponseTests.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
package org.opensearch.searchpipelines.questionanswering.generative;
1919

2020
import static org.mockito.ArgumentMatchers.any;
21+
import static org.mockito.ArgumentMatchers.anyBoolean;
2122
import static org.mockito.Mockito.mock;
2223
import static org.mockito.Mockito.when;
2324

@@ -69,7 +70,7 @@ public void testToXContent() throws IOException {
6970
XContent xc = mock(XContent.class);
7071
OutputStream os = mock(OutputStream.class);
7172
XContentGenerator generator = mock(XContentGenerator.class);
72-
when(xc.createGenerator(any(), any(), any())).thenReturn(generator);
73+
when(xc.createGenerator(any(), any(), any(), anyBoolean())).thenReturn(generator);
7374
XContentBuilder builder = new XContentBuilder(xc, os);
7475
XContentBuilder actual = searchResponse.toXContent(builder, ToXContent.EMPTY_PARAMS);
7576
assertNotNull(actual);
@@ -102,7 +103,7 @@ public void testToXContentWithError() throws IOException {
102103
XContent xc = mock(XContent.class);
103104
OutputStream os = mock(OutputStream.class);
104105
XContentGenerator generator = mock(XContentGenerator.class);
105-
when(xc.createGenerator(any(), any(), any())).thenReturn(generator);
106+
when(xc.createGenerator(any(), any(), any(), anyBoolean())).thenReturn(generator);
106107
XContentBuilder builder = new XContentBuilder(xc, os);
107108
XContentBuilder actual = searchResponse.toXContent(builder, ToXContent.EMPTY_PARAMS);
108109
assertNotNull(actual);

search-processors/src/test/java/org/opensearch/searchpipelines/questionanswering/generative/ext/GenerativeQAParametersTests.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
package org.opensearch.searchpipelines.questionanswering.generative.ext;
1919

2020
import static org.mockito.ArgumentMatchers.any;
21+
import static org.mockito.ArgumentMatchers.anyBoolean;
2122
import static org.mockito.Mockito.*;
2223

2324
import java.io.IOException;
@@ -279,7 +280,7 @@ public void testToXConent() throws IOException {
279280
XContent xc = mock(XContent.class);
280281
OutputStream os = mock(OutputStream.class);
281282
XContentGenerator generator = mock(XContentGenerator.class);
282-
when(xc.createGenerator(any(), any(), any())).thenReturn(generator);
283+
when(xc.createGenerator(any(), any(), any(), anyBoolean())).thenReturn(generator);
283284
XContentBuilder builder = new XContentBuilder(xc, os);
284285
assertNotNull(parameters.toXContent(builder, null));
285286
}
@@ -289,7 +290,7 @@ public void testToXContentEmptyParams() throws IOException {
289290
XContent xc = mock(XContent.class);
290291
OutputStream os = mock(OutputStream.class);
291292
XContentGenerator generator = mock(XContentGenerator.class);
292-
when(xc.createGenerator(any(), any(), any())).thenReturn(generator);
293+
when(xc.createGenerator(any(), any(), any(), anyBoolean())).thenReturn(generator);
293294
XContentBuilder builder = new XContentBuilder(xc, os);
294295
parameters.toXContent(builder, null);
295296
assertNotNull(parameters.toXContent(builder, null));
@@ -319,7 +320,7 @@ public void testToXContentAllOptionalParameters() throws IOException {
319320
XContent xc = mock(XContent.class);
320321
OutputStream os = mock(OutputStream.class);
321322
XContentGenerator generator = mock(XContentGenerator.class);
322-
when(xc.createGenerator(any(), any(), any())).thenReturn(generator);
323+
when(xc.createGenerator(any(), any(), any(), anyBoolean())).thenReturn(generator);
323324
XContentBuilder builder = new XContentBuilder(xc, os);
324325
assertNotNull(parameters.toXContent(builder, null));
325326
}

0 commit comments

Comments
 (0)