@Test
public void put_mapping_throws_correct_exception_when_underlying_client_throws() throws Exception {

    when(client.indices()).thenThrow(new RuntimeException());
    TestUtils.assertThrows(() -> ElasticSearchUtils.putMapping(client, "", null), PutMappingFailedException.class);
}