@Test
void testPubSubMessage() throws Exception {

    // given
    byte[] message = new byte[] {'a', 'b', 'c'};
    TopicID topicID = TopicID.newBuilder().setTopicNum(10L).build();
    EntityId topicIdEntity = EntityId.of(topicID);
    ConsensusSubmitMessageTransactionBody submitMessage = ConsensusSubmitMessageTransactionBody.newBuilder()
            .setMessage(ByteString.copyFrom(message))
            .setTopicID(topicID)
            .build();
    Transaction transaction = buildTransaction(builder -> builder.setConsensusSubmitMessage(submitMessage));
    // when
    doReturn(topicIdEntity).when(transactionHandler).getEntity(any());
    pubSubRecordItemListener.onItem(new RecordItem(transaction.toByteArray(), DEFAULT_RECORD_BYTES));
    // then
    var pubSubMessage = assertPubSubMessage(buildPubSubTransaction(transaction), 1);
    assertThat(pubSubMessage.getEntity()).isEqualTo(topicIdEntity);
    assertThat(pubSubMessage.getNonFeeTransfers()).isNull();
}