@Test(expected = RuntimeException.class)
public void deleteDetectorMapping_fail() throws IOException {

    val id = "adsvade8^szx";
    DeleteRequest deleteRequest = new DeleteRequest(elasticSearchProperties.getIndexName(),
            elasticSearchProperties.getDocType(), id);
    when(legacyElasticSearchClient.delete(any(DeleteRequest.class), eq(RequestOptions.DEFAULT))).thenThrow(new IOException());
    repoUnderTest.deleteDetectorMapping(id);
}