@Test
void should_pass_error_message_to_consumer(@Mock ErrorMessageConsumer errorMessageConsumer) {

    // arrange
    String text = "error";
    ErrorListener errorListener = new ErrorListener(errorMessageConsumer);
    // act
    errorListener.onApplicationEvent(new ErrorEvent(this, text));
    // assert
    verify(errorMessageConsumer).consumeMessage(argumentCaptor.capture());
    ErrorMessage capturedMessage = argumentCaptor.getValue();
    assertThat(capturedMessage.text).isEqualTo(text);
    assertThat(capturedMessage.id).isNotNull();
}