use of com.hedera.mirror.common.domain.balance.AccountBalanceFile in project hedera-mirror-node by hashgraph.
the class AccountBalanceFileParserTest method duplicateFile.
@Test
void duplicateFile() {
// given
AccountBalanceFile accountBalanceFile = accountBalanceFile(1);
AccountBalanceFile duplicate = accountBalanceFile(1);
List<AccountBalance> items = accountBalanceFile.getItems().collectList().block();
// when
accountBalanceFileParser.parse(accountBalanceFile);
// Will be ignored
accountBalanceFileParser.parse(duplicate);
// then
assertThat(accountBalanceFileRepository.count()).isEqualTo(1L);
assertAccountBalanceFile(accountBalanceFile, items);
}
use of com.hedera.mirror.common.domain.balance.AccountBalanceFile in project hedera-mirror-node by hashgraph.
the class AccountBalanceFileParserTest method beforeStartDate.
@Test
void beforeStartDate() {
// given
AccountBalanceFile accountBalanceFile = accountBalanceFile(-1L);
// when
accountBalanceFileParser.parse(accountBalanceFile);
// then
assertThat(accountBalanceFileRepository.findAll()).usingElementComparatorIgnoringFields("bytes", "items").containsExactly(accountBalanceFile);
assertThat(accountBalanceRepository.count()).isZero();
assertAccountBalanceFile(accountBalanceFile, List.of());
}
use of com.hedera.mirror.common.domain.balance.AccountBalanceFile in project hedera-mirror-node by hashgraph.
the class AccountBalanceFileParserTest method errata.
@Test
void errata() {
// given
var network = mirrorProperties.getNetwork();
mirrorProperties.setNetwork(MirrorProperties.HederaNetwork.MAINNET);
AccountBalanceFile accountBalanceFile = accountBalanceFile(BAD_TIMESTAMP1);
List<AccountBalance> items = accountBalanceFile.getItems().collectList().block();
// when
accountBalanceFileParser.parse(accountBalanceFile);
// then
assertAccountBalanceFile(accountBalanceFile, items);
assertThat(accountBalanceFile.getTimeOffset()).isEqualTo(-1);
mirrorProperties.setNetwork(network);
}
Aggregations