@Test
void testNetworkAddressBookAppend() throws Exception {

    // given
    byte[] fileContents = new byte[] {0b0, 0b1, 0b10};
    Transaction transaction = buildTransaction(builder -> {
        builder.setFileAppend(FileAppendTransactionBody.newBuilder()
                .setFileID(ADDRESS_BOOK_FILE_ID)
                .setContents(ByteString.copyFrom(fileContents))
                .build());
    });
    // when
    EntityId entityId = EntityId.of(ADDRESS_BOOK_FILE_ID);
    doReturn(EntityId.of(ADDRESS_BOOK_FILE_ID)).when(transactionHandler).getEntity(any());
    pubSubRecordItemListener.onItem(new RecordItem(transaction.toByteArray(), DEFAULT_RECORD_BYTES));
    // then
    FileData fileData = new FileData(100L, fileContents, entityId, TransactionTypeEnum.FILEAPPEND
            .getProtoId());
    verify(addressBookService).update(fileData);
}