From c59f70bfd7918ca990289a532fadff59e124f88b Mon Sep 17 00:00:00 2001 From: Louis Chu Date: Wed, 24 Jul 2024 14:43:26 -0700 Subject: [PATCH] Fix UT Signed-off-by: Louis Chu --- .../spark/scheduler/OpenSearchAsyncQuerySchedulerTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/async-query/src/test/java/org/opensearch/sql/spark/scheduler/OpenSearchAsyncQuerySchedulerTest.java b/async-query/src/test/java/org/opensearch/sql/spark/scheduler/OpenSearchAsyncQuerySchedulerTest.java index b61069ca5b..de86f111f3 100644 --- a/async-query/src/test/java/org/opensearch/sql/spark/scheduler/OpenSearchAsyncQuerySchedulerTest.java +++ b/async-query/src/test/java/org/opensearch/sql/spark/scheduler/OpenSearchAsyncQuerySchedulerTest.java @@ -199,7 +199,7 @@ public void testUnscheduleJob() throws IOException { public void testUnscheduleJobWithIndexNotFound() { when(clusterService.state().routingTable().hasIndex(SCHEDULER_INDEX_NAME)).thenReturn(false); - assertThrows(IllegalArgumentException.class, () -> scheduler.unscheduleJob(TEST_JOB_ID)); + assertThrows(IllegalStateException.class, () -> scheduler.unscheduleJob(TEST_JOB_ID)); } @Test @@ -237,7 +237,7 @@ public void testUpdateJobWithIndexNotFound() { when(clusterService.state().routingTable().hasIndex(SCHEDULER_INDEX_NAME)).thenReturn(false); - assertThrows(IllegalArgumentException.class, () -> scheduler.updateJob(request)); + assertThrows(IllegalStateException.class, () -> scheduler.updateJob(request)); } @Test @@ -305,7 +305,7 @@ public void testRemoveJob() { public void testRemoveJobWithIndexNotFound() { when(clusterService.state().routingTable().hasIndex(SCHEDULER_INDEX_NAME)).thenReturn(false); - assertThrows(IllegalArgumentException.class, () -> scheduler.removeJob(TEST_JOB_ID)); + assertThrows(IllegalStateException.class, () -> scheduler.removeJob(TEST_JOB_ID)); } @Test