use of com.hedera.mirror.importer.domain.StreamFileData in project hedera-mirror-node by hashgraph.
the class ProtoBalanceFileReaderTest method supports.
@ParameterizedTest(name = "supports {0}")
@ValueSource(strings = { "2021-03-10T16:00:00Z_Balances.pb.gz", "2021-03-10T16:00:00Z_Balances.pb" })
void supports(String filename) {
StreamFileData streamFileData = StreamFileData.from(filename, new byte[] { 1, 2, 3 });
assertThat(protoBalanceFileReader.supports(streamFileData)).isTrue();
}
use of com.hedera.mirror.importer.domain.StreamFileData in project hedera-mirror-node by hashgraph.
the class ProtoBalanceFileReaderTest method unsupported.
@ParameterizedTest(name = "does not support {0}")
@ValueSource(strings = { "2021-03-10T16:00:00Z_Balances.csv", "2021-03-10T16:00:00Z_Balances.csv.gz" })
void unsupported(String filename) {
StreamFileData streamFileData = StreamFileData.from(filename, new byte[] { 1, 2, 3 });
assertThat(protoBalanceFileReader.supports(streamFileData)).isFalse();
}
use of com.hedera.mirror.importer.domain.StreamFileData in project hedera-mirror-node by hashgraph.
the class EventFileReaderV3Test method readInvalidFileWithNoPrevHash.
@Test
void readInvalidFileWithNoPrevHash() {
StreamFileData invalidFile = createEventFile(EventFileReaderV3.EVENT_STREAM_FILE_VERSION_3, EventFileReaderV3.EVENT_TYPE_PREV_HASH, null, null);
assertThrows(InvalidEventFileException.class, () -> eventFileReader.read(invalidFile));
}
use of com.hedera.mirror.importer.domain.StreamFileData in project hedera-mirror-node by hashgraph.
the class EventFileReaderV3Test method readValidFileVersion2.
@Test
void readValidFileVersion2() {
StreamFileData validFile = createEventFile(EventFileReaderV3.EVENT_STREAM_FILE_VERSION_2, EventFileReaderV3.EVENT_TYPE_PREV_HASH, PREVIOUS_HASH, CONTENT);
EventFile eventFile = eventFileReader.read(validFile);
verifyForSuccess(eventFile, validFile, EventFileReaderV3.EVENT_STREAM_FILE_VERSION_2, PREVIOUS_HASH);
}
use of com.hedera.mirror.importer.domain.StreamFileData in project hedera-mirror-node by hashgraph.
the class EventFileReaderV3Test method readValidFileVersion3.
@Test
void readValidFileVersion3() {
StreamFileData validFile = createEventFile(EventFileReaderV3.EVENT_STREAM_FILE_VERSION_3, EventFileReaderV3.EVENT_TYPE_PREV_HASH, PREVIOUS_HASH, CONTENT);
EventFile eventFile = eventFileReader.read(validFile);
verifyForSuccess(eventFile, validFile, EventFileReaderV3.EVENT_STREAM_FILE_VERSION_3, PREVIOUS_HASH);
}
Aggregations