use of com.hedera.mirror.common.domain.entity.Entity in project hedera-mirror-node by hashgraph.
the class EntityRecordItemListenerFileTest method assertFileEntity.
private void assertFileEntity(FileCreateTransactionBody expected, Timestamp consensusTimestamp) {
Entity actualFile = getTransactionEntity(consensusTimestamp);
assertAll(() -> assertFalse(actualFile.getDeleted()), () -> assertEquals(DomainUtils.timeStampInNanos(expected.getExpirationTime()), actualFile.getExpirationTimestamp()), () -> assertEquals(expected.getMemo(), actualFile.getMemo()), () -> assertArrayEquals(expected.getKeys().toByteArray(), actualFile.getKey()), () -> assertNull(actualFile.getAutoRenewPeriod()), () -> assertNull(actualFile.getProxyAccountId()));
}
use of com.hedera.mirror.common.domain.entity.Entity in project hedera-mirror-node by hashgraph.
the class EntityRecordItemListenerFileTest method fileDeleteToNew.
@Test
void fileDeleteToNew() {
Transaction fileDeleteTransaction = fileDeleteTransaction();
TransactionBody transactionBody = getTransactionBody(fileDeleteTransaction);
TransactionRecord record = transactionRecord(transactionBody);
parseRecordItemAndCommit(new RecordItem(fileDeleteTransaction, record));
Entity fileEntity = getTransactionEntity(record.getConsensusTimestamp());
assertAll(() -> assertRowCountOnSuccessNoData(FILE_ID), () -> assertTransactionAndRecord(transactionBody, record), () -> assertFileEntityHasNullFields(record.getConsensusTimestamp()), () -> assertTrue(fileEntity.getDeleted()));
}
use of com.hedera.mirror.common.domain.entity.Entity in project hedera-mirror-node by hashgraph.
the class EntityRecordItemListenerFileTest method fileUpdateContentsToNew.
@Test
void fileUpdateContentsToNew() {
Transaction transaction = fileUpdateContentsTransaction();
TransactionBody transactionBody = getTransactionBody(transaction);
TransactionRecord record = transactionRecord(transactionBody);
parseRecordItemAndCommit(new RecordItem(transaction, record));
Entity actualFile = getTransactionEntity(record.getConsensusTimestamp());
assertAll(() -> assertRowCountOnSuccess(FILE_ID), () -> assertTransactionAndRecord(transactionBody, record), () -> assertFileData(transactionBody.getFileUpdate().getContents(), record.getConsensusTimestamp()), // Additional entity checks
() -> assertFalse(actualFile.getDeleted()), () -> assertNull(actualFile.getKey()), () -> assertNull(actualFile.getAutoRenewPeriod()), () -> assertNull(actualFile.getProxyAccountId()));
}
use of com.hedera.mirror.common.domain.entity.Entity in project hedera-mirror-node by hashgraph.
the class EntityRecordItemListenerFileTest method assertFileEntity.
private void assertFileEntity(FileUpdateTransactionBody expected, Timestamp consensusTimestamp) {
Entity actualFile = getTransactionEntity(consensusTimestamp);
assertAll(() -> assertEquals(DomainUtils.timeStampInNanos(expected.getExpirationTime()), actualFile.getExpirationTimestamp()), () -> assertFalse(actualFile.getDeleted()), () -> assertEquals(expected.getMemo().getValue(), actualFile.getMemo()), () -> assertArrayEquals(expected.getKeys().toByteArray(), actualFile.getKey()), () -> assertNull(actualFile.getAutoRenewPeriod()), () -> assertNull(actualFile.getProxyAccountId()));
}
use of com.hedera.mirror.common.domain.entity.Entity in project hedera-mirror-node by hashgraph.
the class EntityRecordItemListenerFileTest method assertFileEntityHasNullFields.
private void assertFileEntityHasNullFields(Timestamp consensusTimestamp) {
Entity actualFile = getTransactionEntity(consensusTimestamp);
assertAll(() -> assertNull(actualFile.getKey()), () -> assertNull(actualFile.getExpirationTimestamp()), () -> assertNull(actualFile.getAutoRenewPeriod()), () -> assertNull(actualFile.getProxyAccountId()));
}
Aggregations