@Test
void testNonRetryableError() {

    // when
    CryptoTransferTransactionBody cryptoTransfer = CryptoTransferTransactionBody.newBuilder()
            .setTransfers(TransferList.newBuilder().build())
            .build();
    Transaction transaction = buildTransaction(builder -> builder.setCryptoTransfer(cryptoTransfer));
    // when
    when(messageChannel.send(any())).thenThrow(RuntimeException.class);
    // then
    assertThatThrownBy(
            () -> pubSubRecordItemListener.onItem(
                    new RecordItem(transaction.toByteArray(), DEFAULT_RECORD_BYTES)))
            .isInstanceOf(ParserException.class)
            .hasMessageContaining("Error sending transaction to pubsub");
    verify(messageChannel, times(1)).send(any());
}