@Test
void publishError() throws IOException {

    when(elasticSearchClient.stats("localhost")).thenThrow(new HTTPClientException("mock", "MOCK_ERROR_CODE", null));
    job.execute(null);
    verify(publisher).publish(argThat(message -> "es".equals(message.app)
            && "ERROR".equals(message.result)
            && "FAILED_TO_COLLECT".equals(message.errorCode)));
}