| Modifier and Type | Method and Description |
|---|---|
TestKit |
build()
Creates the TestKit instance.
|
TestKit.Builder |
copy()
Returns a copy of this TestKit builder.
|
TestKit.Builder |
withNodeType(EmulatedNodeType nodeType)
Sets the type of the main TestKit node - either validator or auditor.
|
TestKit.Builder |
withService(Class<? extends com.exonum.binding.core.service.ServiceModule> serviceModule)
Adds a service with which the TestKit would be instantiated.
|
TestKit.Builder |
withServices(Class<? extends com.exonum.binding.core.service.ServiceModule> serviceModule,
Class<? extends com.exonum.binding.core.service.ServiceModule>... serviceModules)
Adds services with which the TestKit would be instantiated.
|
TestKit.Builder |
withServices(Iterable<Class<? extends com.exonum.binding.core.service.ServiceModule>> serviceModules)
Adds services with which the TestKit would be instantiated.
|
TestKit.Builder |
withTimeService(TimeProvider timeProvider)
If called, will create a TestKit with time service enabled.
|
TestKit.Builder |
withValidators(short validatorCount)
Sets number of validator nodes in the TestKit network, should be positive.
|
public TestKit.Builder copy()
public TestKit.Builder withNodeType(EmulatedNodeType nodeType)
Service.afterCommit(BlockCommittedEvent) logic will only be called on the main
TestKit node of this typepublic TestKit.Builder withValidators(short validatorCount)
Note that validator count should be or less if time service is enabled.
IllegalArgumentException - if validatorCount is less than onepublic TestKit.Builder withService(Class<? extends com.exonum.binding.core.service.ServiceModule> serviceModule)
@SafeVarargs public final TestKit.Builder withServices(Class<? extends com.exonum.binding.core.service.ServiceModule> serviceModule, Class<? extends com.exonum.binding.core.service.ServiceModule>... serviceModules)
public TestKit.Builder withServices(Iterable<Class<? extends com.exonum.binding.core.service.ServiceModule>> serviceModules)
public TestKit.Builder withTimeService(TimeProvider timeProvider)
Note that validator count should be or less if time service is enabled.
public TestKit build()
IllegalArgumentException - if validator count is invalidIllegalArgumentException - if service number is invalidCopyright © 2019 Exonum. All rights reserved.