Skip to content

Commit

Permalink
Add UT
Browse files Browse the repository at this point in the history
Signed-off-by: b4sjoo <[email protected]>
  • Loading branch information
b4sjoo committed Dec 19, 2024
1 parent 3d54eb5 commit b639ffc
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions plugin/src/test/java/org/opensearch/ml/utils/MLNodeUtilsTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,31 @@ public void testValidateSchema() throws IOException {
MLNodeUtils.validateSchema(schema, json);
}

@Test
public void testValidateEmbeddingInputWithRemoteSchema() throws IOException {
String schema = "{\n"
+ " \"type\": \"object\",\n"
+ " \"properties\": {\n"
+ " \"parameters\": {\n"
+ " \"type\": \"object\",\n"
+ " \"properties\": {\n"
+ " \"texts\": {\n"
+ " \"type\": \"array\",\n"
+ " \"items\": {\n"
+ " \"type\": \"string\"\n"
+ " }\n"
+ " }\n"
+ " },\n"
+ " \"required\": [\n"
+ " \"texts\"\n"
+ " ]\n"
+ " }\n"
+ " }\n"
+ "}";
String json = "{\"text_docs\":[ \"today is sunny\", \"today is sunny\"]}";
MLNodeUtils.validateSchema(schema, json);
}

@Test
public void testProcessRemoteInferenceInputDataSetParametersValueNoParameters() throws IOException {
String json = "{\"key1\":\"foo\",\"key2\":123,\"key3\":true}";
Expand Down

0 comments on commit b639ffc

Please sign in to comment.