Search in sources :

Example 1 with FileCopier

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());
}
Also used : AddressBook(com.hedera.mirror.common.domain.addressbook.AddressBook) NodeAddressBook(com.hederahashgraph.api.proto.java.NodeAddressBook) MirrorProperties(com.hedera.mirror.importer.MirrorProperties) FileCopier(com.hedera.mirror.importer.FileCopier) Test(org.junit.jupiter.api.Test) IntegrationTest(com.hedera.mirror.importer.IntegrationTest)

Aggregations

AddressBook (com.hedera.mirror.common.domain.addressbook.AddressBook)1 FileCopier (com.hedera.mirror.importer.FileCopier)1 IntegrationTest (com.hedera.mirror.importer.IntegrationTest)1 MirrorProperties (com.hedera.mirror.importer.MirrorProperties)1 NodeAddressBook (com.hederahashgraph.api.proto.java.NodeAddressBook)1 Test (org.junit.jupiter.api.Test)1