Class TestKit.Builder

  • Enclosing class:
    TestKit

    public static final class TestKit.Builder
    extends Object
    Builder for the TestKit.
    • Method Detail

      • copy

        public TestKit.Builder copy()
        Returns a copy of this TestKit builder.
      • withValidators

        public TestKit.Builder withValidators​(short validatorCount)
        Sets number of validator nodes in the TestKit network, should be positive. Note that regardless of the configured number of validators, only a single service will be instantiated. Equal to one by default.

        Note that validator count should be 3 or less if time service is enabled.

        Throws:
        IllegalArgumentException - if validatorCount is less than one
      • withService

        public TestKit.Builder withService​(Class<? extends ServiceModule> serviceModule)
        Adds a service with which the TestKit would be instantiated. Several services can be added.
      • withTimeService

        public TestKit.Builder withTimeService​(TimeProvider timeProvider)
        If called, will create a TestKit with time service enabled. The time service will use the given TimeProvider as a time source.

        Note that validator count should be 3 or less if time service is enabled.