Skip to content

Commit b54f293

Browse files
committed
Add test for missing required option validation path
Signed-off-by: Eric Wei <mengwei.eric@gmail.com>
1 parent 5da2001 commit b54f293

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

opensearch/src/test/java/org/opensearch/sql/opensearch/storage/VectorSearchTableFunctionImplementationTest.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,15 @@ void testDuplicateOptionKeyThrows() {
138138
assertTrue(ex.getMessage().contains("Duplicate option key"));
139139
}
140140

141+
@Test
142+
void testNoRequiredOptionThrows() {
143+
VectorSearchTableFunctionImplementation impl =
144+
createImplWithArgs("my-index", "embedding", "[1.0, 2.0]", "");
145+
ExpressionEvaluationException ex =
146+
assertThrows(ExpressionEvaluationException.class, () -> impl.applyArguments());
147+
assertTrue(ex.getMessage().contains("Missing required option"));
148+
}
149+
141150
@Test
142151
void testEmptyVectorThrows() {
143152
VectorSearchTableFunctionImplementation impl =

0 commit comments

Comments
 (0)