Fix Mockito trying to mock IOException that isn't thrown by method (#31433) (#31527)

This commit is contained in:
Armin Braun 2018-06-22 17:24:27 +02:00 committed by GitHub
parent 16e4e7a7cf
commit 3c42bfad4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -460,7 +460,6 @@ public class HttpExporterTests extends ESTestCase {
}
}
@AwaitsFix (bugUrl = "https://github.com/elastic/elasticsearch/issues/31433" )
public void testHttpExporterShutdown() throws Exception {
final Config config = createConfig(Settings.EMPTY);
final RestClient client = mock(RestClient.class);
@ -469,7 +468,7 @@ public class HttpExporterTests extends ESTestCase {
final MultiHttpResource resource = mock(MultiHttpResource.class);
if (sniffer != null && rarely()) {
doThrow(randomFrom(new IOException("expected"), new RuntimeException("expected"))).when(sniffer).close();
doThrow(new RuntimeException("expected")).when(sniffer).close();
}
if (rarely()) {