use of com.hedera.mirror.importer.FileCopier in project hedera-mirror-node by hashgraph.
the class AddressBookServiceImplTest method startupWithOtherNetwork.
@Test
void startupWithOtherNetwork() {
// copy other addressbook to file system
FileCopier fileCopier = FileCopier.create(testPath, dataPath).from("").filterFiles("test-v1").to("");
fileCopier.copy();
MirrorProperties otherNetworkMirrorProperties = new MirrorProperties();
otherNetworkMirrorProperties.setDataPath(dataPath);
otherNetworkMirrorProperties.setInitialAddressBook(dataPath.resolve("test-v1"));
otherNetworkMirrorProperties.setNetwork(MirrorProperties.HederaNetwork.OTHER);
AddressBookService customAddressBookService = new AddressBookServiceImpl(addressBookRepository, fileDataRepository, otherNetworkMirrorProperties, transactionTemplate);
AddressBook addressBook = customAddressBookService.getCurrent();
assertThat(addressBook.getStartConsensusTimestamp()).isEqualTo(1L);
assertEquals(1, addressBookRepository.count());
}
Aggregations