Skip to content

Commit baa5743

Browse files
committed
format code
Signed-off-by: zane-neo <[email protected]>
1 parent 6d843f1 commit baa5743

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

plugin/src/test/java/org/opensearch/ml/utils/MLNodeUtilsForTestingTests.java

+10-9
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import java.util.HashSet;
1616
import java.util.Set;
1717

18-
import com.fasterxml.jackson.core.JsonParseException;
1918
import org.junit.Assert;
2019
import org.junit.Test;
2120
import org.opensearch.Version;
@@ -30,6 +29,8 @@
3029
import org.opensearch.ml.common.MLTask;
3130
import org.opensearch.test.OpenSearchTestCase;
3231

32+
import com.fasterxml.jackson.core.JsonParseException;
33+
3334
public class MLNodeUtilsForTestingTests extends OpenSearchTestCase {
3435

3536
public void testIsMLNode() {
@@ -107,11 +108,11 @@ public void testValidateEmbeddingInputWithTitanMultiModalRemoteSchema() throws I
107108
public void testValidateRemoteInputWithTitanMultiModalRemoteSchema() throws IOException {
108109
String schema = BEDROCK_TITAN_EMBED_MULTI_MODAL_V1_MODEL_INTERFACE.get("input");
109110
String json = "{\n"
110-
+ " \"parameters\": {\n"
111-
+ " \"inputText\": \"Say this is a test\",\n"
112-
+ " \"inputImage\": \"/9jk=\"\n"
113-
+ " }\n"
114-
+ "}";
111+
+ " \"parameters\": {\n"
112+
+ " \"inputText\": \"Say this is a test\",\n"
113+
+ " \"inputImage\": \"/9jk=\"\n"
114+
+ " }\n"
115+
+ "}";
115116
MLNodeUtilsForTesting.validateSchema(schema, json);
116117
}
117118

@@ -153,9 +154,9 @@ public void testProcessRemoteInferenceInputDataSetParametersValueWithParametersP
153154
@Test
154155
public void testProcessRemoteInferenceInputDataSetParametersValueWithParametersProcessObject() throws IOException {
155156
String json =
156-
"{\"key1\":\"foo\",\"key2\":123,\"key3\":true,\"parameters\":{\"messages\":\"{\\\"role\\\":\\\"system\\\",\\\"foo\\\":\\\"{\\\\\\\"a\\\\\\\": \\\\\\\"b\\\\\\\"}\\\",\\\"content\\\":{\\\"a\\\":\\\"b\\\"}}\"}}}";
157+
"{\"key1\":\"foo\",\"key2\":123,\"key3\":true,\"parameters\":{\"messages\":\"{\\\"role\\\":\\\"system\\\",\\\"foo\\\":\\\"{\\\\\\\"a\\\\\\\": \\\\\\\"b\\\\\\\"}\\\",\\\"content\\\":{\\\"a\\\":\\\"b\\\"}}\"}}}";
157158
String expectedJson =
158-
"{\"key1\":\"foo\",\"key2\":123,\"key3\":true,\"parameters\":{\"messages\":{\"role\":\"system\",\"foo\":\"{\\\"a\\\": \\\"b\\\"}\",\"content\":{\"a\":\"b\"}}}}";
159+
"{\"key1\":\"foo\",\"key2\":123,\"key3\":true,\"parameters\":{\"messages\":{\"role\":\"system\",\"foo\":\"{\\\"a\\\": \\\"b\\\"}\",\"content\":{\"a\":\"b\"}}}}";
159160
String processedJson = MLNodeUtilsForTesting.processRemoteInferenceInputDataSetParametersValue(json);
160161
assertEquals(expectedJson, processedJson);
161162
}
@@ -170,7 +171,7 @@ public void testProcessRemoteInferenceInputDataSetParametersValueWithParametersN
170171
@Test
171172
public void testProcessRemoteInferenceInputDataSetParametersValueWithParametersInvalidJson() throws IOException {
172173
String json =
173-
"{\"key1\":\"foo\",\"key2\":123,\"key3\":true,\"parameters\":{\"key1\":\"foo\",\"key2\":123,\"key3\":true,\"texts\":\"[\\\"Hello\\\",\\\"world\\\"\"}}";
174+
"{\"key1\":\"foo\",\"key2\":123,\"key3\":true,\"parameters\":{\"key1\":\"foo\",\"key2\":123,\"key3\":true,\"texts\":\"[\\\"Hello\\\",\\\"world\\\"\"}}";
174175
String processedJson = MLNodeUtilsForTesting.processRemoteInferenceInputDataSetParametersValue(json);
175176
assertEquals(json, processedJson);
176177
}

0 commit comments

Comments
 (0)