@Test
void publishError() throws IOException {

    when(jmxClient.connect()).thenThrow(new IOException("mock"));
    job.execute(null);
    verify(publisher).publish(argThat(message -> "kafka".equals(message.app)
            && "ERROR".equals(message.result)
            && "FAILED_TO_COLLECT".equals(message.errorCode)));
}