Skip to content

Commit

Permalink
Fix broken UT
Browse files Browse the repository at this point in the history
Signed-off-by: Chen Dai <daichen@amazon.com>
  • Loading branch information
dai-chen committed Dec 1, 2023
1 parent 54aef87 commit 3582e4f
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,19 @@
package org.opensearch.sql.spark.dispatcher;

import static org.junit.jupiter.api.Assertions.*;
import static org.opensearch.sql.spark.data.constants.SparkConstants.ERROR_FIELD;
import static org.opensearch.sql.spark.data.constants.SparkConstants.STATUS_FIELD;

import org.json.JSONObject;
import org.junit.jupiter.api.Test;

class IndexDMLHandlerTest {
@Test
public void getResponseFromExecutor() {
assertThrows(
IllegalStateException.class,
() ->
new IndexDMLHandler(null, null, null, null, null, null, null)
.getResponseFromExecutor(null));
JSONObject result =
new IndexDMLHandler(null, null, null, null, null, null, null).getResponseFromExecutor(null);

assertEquals("running", result.getString(STATUS_FIELD));
assertEquals("", result.getString(ERROR_FIELD));
}
}

0 comments on commit 3582e4f

Please sign in to comment.