@Test
void testSendRetries() throws Exception {

    // when
    CryptoTransferTransactionBody cryptoTransfer = CryptoTransferTransactionBody.newBuilder()
            .setTransfers(TransferList.newBuilder().build())
            .build();
    Transaction transaction = buildTransaction(builder -> builder.setCryptoTransfer(cryptoTransfer));
    pubSubProperties.setMaxSendAttempts(3);
    // when
    when(messageChannel.send(any()))
            .thenThrow(MessageTimeoutException.class)
            .thenThrow(MessageTimeoutException.class)
            .thenReturn(true);
    pubSubRecordItemListener.onItem(new RecordItem(transaction.toByteArray(), DEFAULT_RECORD_BYTES));
    // then
    var pubSubMessage = assertPubSubMessage(buildPubSubTransaction(transaction), 3);
    assertThat(pubSubMessage.getEntity()).isNull();
    assertThat(pubSubMessage.getNonFeeTransfers()).isNull();
}