use of io.nem.symbol.sdk.api.RepositoryFactoryConfiguration in project nem2-sdk-java by nemtech.
the class RepositoryFactoryVertxImplTest method getRestProvidedNetworkCurrencies.
@Test
public void getRestProvidedNetworkCurrencies() throws Exception {
String baseUrl = "https://localhost:1934/path";
RepositoryFactoryConfiguration configuration = new RepositoryFactoryConfiguration(baseUrl);
configuration.withGenerationHash("abc");
configuration.withNetworkType(NetworkType.MAIN_NET);
RepositoryFactory factory = new RepositoryFactoryVertxImpl(configuration) {
@Override
protected Observable<NetworkCurrencies> loadNetworkCurrencies() {
return Observable.just(new NetworkCurrencies(Currency.CAT_CURRENCY, Currency.CAT_HARVEST));
}
};
Assertions.assertEquals(configuration.getNetworkType(), factory.getNetworkType().toFuture().get());
Assertions.assertEquals(configuration.getGenerationHash(), factory.getGenerationHash().toFuture().get());
Assertions.assertEquals(Currency.CAT_HARVEST, factory.getHarvestCurrency().toFuture().get());
Assertions.assertEquals(Currency.CAT_CURRENCY, factory.getNetworkCurrency().toFuture().get());
}
Aggregations