Skip to content

Commit 3c42bfa

Browse files
Fix Mockito trying to mock IOException that isn't thrown by method (#31433) (#31527)
1 parent 16e4e7a commit 3c42bfa

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExporterTests.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,6 @@ public void testHttpExporter() throws Exception {
460460
}
461461
}
462462

463-
@AwaitsFix (bugUrl = "https://github.com/elastic/elasticsearch/issues/31433" )
464463
public void testHttpExporterShutdown() throws Exception {
465464
final Config config = createConfig(Settings.EMPTY);
466465
final RestClient client = mock(RestClient.class);
@@ -469,7 +468,7 @@ public void testHttpExporterShutdown() throws Exception {
469468
final MultiHttpResource resource = mock(MultiHttpResource.class);
470469

471470
if (sniffer != null && rarely()) {
472-
doThrow(randomFrom(new IOException("expected"), new RuntimeException("expected"))).when(sniffer).close();
471+
doThrow(new RuntimeException("expected")).when(sniffer).close();
473472
}
474473

475474
if (rarely()) {

0 commit comments

Comments
 (0)