@Test
void getIndexMappingsWithIOException() throws IOException {

  when(restClient.indices().getMapping(any(GetMappingsRequest.class), any()))
      .thenThrow(new IOException());
  assertThrows(IllegalStateException.class, () -> client.getIndexMappings("test"));
}