diff --git a/server/src/test/java/org/opensearch/action/search/AbstractSearchAsyncActionTests.java b/server/src/test/java/org/opensearch/action/search/AbstractSearchAsyncActionTests.java index fa15df58666ac..b44b59b8a4ad5 100644 --- a/server/src/test/java/org/opensearch/action/search/AbstractSearchAsyncActionTests.java +++ b/server/src/test/java/org/opensearch/action/search/AbstractSearchAsyncActionTests.java @@ -407,7 +407,7 @@ public void onResponse(SearchResponse response) { public void onFailure(Exception e) { if (fail.compareAndExchange(true, false)) { try { - throw new NullPointerException("Simulated exception"); + throw new RuntimeException("Simulated exception"); } finally { executor.submit(() -> latch.countDown()); } @@ -451,7 +451,7 @@ public void testOnShardSuccessPhaseDoneFailure() throws InterruptedException { @Override public void onResponse(SearchResponse response) { if (fail.compareAndExchange(true, false)) { - throw new NullPointerException("Simulated exception"); + throw new RuntimeException("Simulated exception"); } }