Class TestStandaloneGateway

java.lang.Object
io.camunda.zeebe.qa.util.cluster.TestStandaloneGateway
All Implemented Interfaces:
TestApplication<TestStandaloneGateway>, TestGateway<TestStandaloneGateway>, AutoCloseable

public final class TestStandaloneGateway extends Object implements TestGateway<TestStandaloneGateway>
Encapsulates an instance of the StandaloneGateway Spring application.
  • Constructor Details

    • TestStandaloneGateway

      public TestStandaloneGateway()
  • Method Details

    • self

      public TestStandaloneGateway self()
      Description copied from interface: TestApplication
      Convenience method to return the appropriate concrete type
      Specified by:
      self in interface TestApplication<TestStandaloneGateway>
    • nodeId

      public MemberId nodeId()
      Description copied from interface: TestApplication
      Returns this node's unique cluster ID
      Specified by:
      nodeId in interface TestApplication<TestStandaloneGateway>
    • host

      public String host()
      Description copied from interface: TestApplication
      Returns the hostname of this node, such that it is visible to hosts from the outside of the Docker network.
      Specified by:
      host in interface TestApplication<TestStandaloneGateway>
      Returns:
      the hostname of this node
    • isGateway

      public boolean isGateway()
      Description copied from interface: TestApplication
      Returns true if this node can act as a gateway (e.g. broker with embedded gateway)
      Specified by:
      isGateway in interface TestApplication<TestStandaloneGateway>
      Specified by:
      isGateway in interface TestGateway<TestStandaloneGateway>
    • mappedPort

      public int mappedPort(TestZeebePort port)
      Description copied from interface: TestApplication
      Returns the actual port for the given logical port.
      Specified by:
      mappedPort in interface TestApplication<TestStandaloneGateway>
    • withGatewayConfig

      public TestStandaloneGateway withGatewayConfig(Consumer<GatewayCfg> modifier)
      Description copied from interface: TestGateway
      Allows modifying the gateway configuration. Changes will not take effect until the node is restarted.
      Specified by:
      withGatewayConfig in interface TestGateway<TestStandaloneGateway>
    • gatewayConfig

      public GatewayCfg gatewayConfig()
      Description copied from interface: TestGateway
      Returns the gateway configuration for this node.
      Specified by:
      gatewayConfig in interface TestGateway<TestStandaloneGateway>
    • start

      public TestStandaloneGateway start()
      Description copied from interface: TestApplication
      Starts the node in a blocking fashion.
      Specified by:
      start in interface TestApplication<T extends io.camunda.zeebe.qa.util.cluster.TestSpringApplication<T>>
    • stop

      public TestStandaloneGateway stop()
      Description copied from interface: TestApplication
      Attempts to stop the container gracefully in a blocking fashion.
      Specified by:
      stop in interface TestApplication<T extends io.camunda.zeebe.qa.util.cluster.TestSpringApplication<T>>
    • isStarted

      public boolean isStarted()
      Description copied from interface: TestApplication
      Returns whether the underlying application is started yet; does not include any probes
      Specified by:
      isStarted in interface TestApplication<T extends io.camunda.zeebe.qa.util.cluster.TestSpringApplication<T>>
    • withBean

      public <V> TestStandaloneGateway withBean(String qualifier, V bean, Class<V> type)
      Description copied from interface: TestApplication
      When the underlying application is started, all beans of the given type will resolve to the given value. The qualifier is useful for cases where more than one beans of the same type are defined with different qualifiers.
      Specified by:
      withBean in interface TestApplication<T extends io.camunda.zeebe.qa.util.cluster.TestSpringApplication<T>>
      Type Parameters:
      V - the bean type
      Parameters:
      qualifier - the bean name/qualifier
      bean - the object to inject as the bean value
      type - the type to be resolved/autowired
      Returns:
      itself for chaining
    • bean

      public <V> V bean(Class<V> type)
      Description copied from interface: TestApplication
      If the application is started (e.g. TestApplication.isStarted(), resolves and returns (i.e. auto-wires) the first bean of the given type.
      Specified by:
      bean in interface TestApplication<T extends io.camunda.zeebe.qa.util.cluster.TestSpringApplication<T>>
      Type Parameters:
      V - the expected bean type
      Parameters:
      type - the expected bean type
      Returns:
      the bean (if any was resolved), or null
    • property

      public <V> V property(String property, Class<V> type, V fallback)
      Description copied from interface: TestApplication
      If the application is started (e.g. TestApplication.isStarted(), resolves and returns the value for this property, or a given fallback if there was none set. If the application is not started, it will look it up only in the property overrides (e.g. TestApplication.withProperty(String, Object).
      Specified by:
      property in interface TestApplication<T extends io.camunda.zeebe.qa.util.cluster.TestSpringApplication<T>>
      Type Parameters:
      V - the expected property type type
      Parameters:
      property - the key identifying this property
      type - the expected type of the property value
      fallback - a default value if the property is not set
      Returns:
      the value of this (if any was resolved), or the fallback value
    • withProperty

      public TestStandaloneGateway withProperty(String key, Object value)
      Description copied from interface: TestApplication
      Configures Spring via properties. This does not work with properties that would be applied to injected beans (e.g. via TestApplication.withBean(String, Object, Class)), since there will be property resolution for these beans.
      Specified by:
      withProperty in interface TestApplication<T extends io.camunda.zeebe.qa.util.cluster.TestSpringApplication<T>>
      Parameters:
      key - the property key
      value - the new value
      Returns:
      itself for chaining
    • withAdditionalProfile

      public TestStandaloneGateway withAdditionalProfile(String profile)
      Description copied from interface: TestApplication
      Configures additional active Spring profiles.
      Specified by:
      withAdditionalProfile in interface TestApplication<T extends io.camunda.zeebe.qa.util.cluster.TestSpringApplication<T>>
      Parameters:
      profile - the profile ID
      Returns:
      itself for chaining
    • commandLineArgs

      protected String[] commandLineArgs()
      Returns the command line arguments that will be passed when the application is started.
    • createSpringBuilder

      protected org.springframework.boot.builder.SpringApplicationBuilder createSpringBuilder()
      Returns a builder which can be modified to enable more profiles, inject beans, etc. Sub-classes can override this to customize the behavior of the test application.
    • toString

      public String toString()
      Overrides:
      toString in class Object