use of com.hedera.mirror.common.domain.transaction.RecordFile in project hedera-mirror-node by hashgraph.
the class RecordFileParserTest method allFiltered.
@Test
void allFiltered() {
RecordFile recordFile = (RecordFile) getStreamFile();
when(mirrorDateRangePropertiesProcessor.getDateRangeFilter(parserProperties.getStreamType())).thenReturn(DateRangeFilter.empty());
parser.parse(recordFile);
verifyNoInteractions(recordItemListener);
verify(recordStreamFileListener).onEnd(recordFile);
assertPostParseStreamFile(recordFile, true);
}
use of com.hedera.mirror.common.domain.transaction.RecordFile in project hedera-mirror-node by hashgraph.
the class RecordFileParserTest method assertParsed.
@Override
protected void assertParsed(StreamFile streamFile, boolean parsed, boolean dbError) {
RecordFile recordFile = (RecordFile) streamFile;
if (parsed) {
verify(recordItemListener).onItem(recordItem);
verify(recordStreamFileListener).onEnd(recordFile);
verify(recordStreamFileListener, never()).onError();
} else {
if (dbError) {
verify(recordStreamFileListener, never()).onEnd(recordFile);
verify(recordStreamFileListener).onError();
} else {
verify(recordStreamFileListener, never()).onStart();
}
}
}
use of com.hedera.mirror.common.domain.transaction.RecordFile in project hedera-mirror-node by hashgraph.
the class AbstractEntityRecordItemListenerTest method parseRecordItemAndCommit.
protected void parseRecordItemAndCommit(RecordItem recordItem) {
transactionTemplate.executeWithoutResult(status -> {
Instant instant = Instant.ofEpochSecond(0, recordItem.getConsensusTimestamp());
String filename = StreamFilename.getFilename(StreamType.RECORD, DATA, instant);
long consensusStart = recordItem.getConsensusTimestamp();
RecordFile recordFile = recordFile(consensusStart, consensusStart + 1, filename);
recordStreamFileListener.onStart();
entityRecordItemListener.onItem(recordItem);
// commit, close connection
recordStreamFileListener.onEnd(recordFile);
});
}
Aggregations