use of io.nem.symbol.sdk.model.network.AggregateNetworkProperties in project nem2-sdk-java by nemtech.
the class AggregateTransactionServiceTest method getNetworkMaxCosignaturesPerAggregateWhenValidInvalid.
@Test
void getNetworkMaxCosignaturesPerAggregateWhenValidInvalid() {
NetworkConfiguration configuration = Mockito.mock(NetworkConfiguration.class);
PluginsProperties pluginsProperties = Mockito.mock(PluginsProperties.class);
AggregateNetworkProperties aggregateNetworkProperties = Mockito.mock(AggregateNetworkProperties.class);
Mockito.when(pluginsProperties.getAggregate()).thenReturn(aggregateNetworkProperties);
Mockito.when(configuration.getPlugins()).thenReturn(pluginsProperties);
Mockito.when(networkRepository.getNetworkProperties()).thenReturn(Observable.just(configuration));
IllegalStateException exception = Assertions.assertThrows(IllegalStateException.class, () -> ExceptionUtils.propagate(() -> service.getNetworkMaxCosignaturesPerAggregate().toFuture().get()));
Assertions.assertEquals("Cannot get maxCosignaturesPerAggregate from network properties.", exception.getMessage());
}
use of io.nem.symbol.sdk.model.network.AggregateNetworkProperties in project nem2-sdk-java by nemtech.
the class AggregateTransactionServiceTest method getNetworkMaxCosignaturesPerAggregateWhenValid.
@Test
void getNetworkMaxCosignaturesPerAggregateWhenValid() throws ExecutionException, InterruptedException {
NetworkConfiguration configuration = Mockito.mock(NetworkConfiguration.class);
PluginsProperties pluginsProperties = Mockito.mock(PluginsProperties.class);
AggregateNetworkProperties aggregateNetworkProperties = Mockito.mock(AggregateNetworkProperties.class);
Mockito.when(aggregateNetworkProperties.getMaxCosignaturesPerAggregate()).thenReturn("25");
Mockito.when(pluginsProperties.getAggregate()).thenReturn(aggregateNetworkProperties);
Mockito.when(configuration.getPlugins()).thenReturn(pluginsProperties);
Mockito.when(networkRepository.getNetworkProperties()).thenReturn(Observable.just(configuration));
Integer maxCosignaturesPerAggregate = service.getNetworkMaxCosignaturesPerAggregate().toFuture().get();
Assertions.assertEquals(25, maxCosignaturesPerAggregate);
}
Aggregations