Package io.camunda.zeebe.qa.util.cluster
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<V> VIf the application is started (e.g.protected String[]Returns the command line arguments that will be passed when the application is started.protected org.springframework.boot.builder.SpringApplicationBuilderReturns a builder which can be modified to enable more profiles, inject beans, etc.Returns the gateway configuration for this node.host()Returns the hostname of this node, such that it is visible to hosts from the outside of the Docker network.booleanReturns true if this node can act as a gateway (e.g.booleanReturns whether the underlying application is started yet; does not include any probesintmappedPort(TestZeebePort port) Returns the actual port for the given logical port.nodeId()Returns this node's unique cluster ID<V> VIf the application is started (e.g.self()Convenience method to return the appropriate concrete typestart()Starts the node in a blocking fashion.stop()Attempts to stop the container gracefully in a blocking fashion.toString()withAdditionalProfile(String profile) Configures additional active Spring profiles.When the underlying application is started, all beans of the given type will resolve to the given value.withGatewayConfig(Consumer<GatewayCfg> modifier) Allows modifying the gateway configuration.withProperty(String key, Object value) Configures Spring via properties.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.camunda.zeebe.qa.util.cluster.TestApplication
actuatorUri, address, address, await, await, bean, close, isStarted, monitoringUri, probe, property, start, stop, uri, uri, withAdditionalProfile, withAdditionalProfile, withBean, withPropertyMethods inherited from interface io.camunda.zeebe.qa.util.cluster.TestGateway
awaitCompleteTopology, awaitCompleteTopology, gatewayHealth, grpcAddress, healthActuator, newClientBuilder, restAddress
-
Constructor Details
-
TestStandaloneGateway
public TestStandaloneGateway()
-
-
Method Details
-
self
Description copied from interface:TestApplicationConvenience method to return the appropriate concrete type- Specified by:
selfin interfaceTestApplication<TestStandaloneGateway>
-
nodeId
Description copied from interface:TestApplicationReturns this node's unique cluster ID- Specified by:
nodeIdin interfaceTestApplication<TestStandaloneGateway>
-
host
Description copied from interface:TestApplicationReturns the hostname of this node, such that it is visible to hosts from the outside of the Docker network.- Specified by:
hostin interfaceTestApplication<TestStandaloneGateway>- Returns:
- the hostname of this node
-
isGateway
public boolean isGateway()Description copied from interface:TestApplicationReturns true if this node can act as a gateway (e.g. broker with embedded gateway)- Specified by:
isGatewayin interfaceTestApplication<TestStandaloneGateway>- Specified by:
isGatewayin interfaceTestGateway<TestStandaloneGateway>
-
mappedPort
Description copied from interface:TestApplicationReturns the actual port for the given logical port.- Specified by:
mappedPortin interfaceTestApplication<TestStandaloneGateway>
-
withGatewayConfig
Description copied from interface:TestGatewayAllows modifying the gateway configuration. Changes will not take effect until the node is restarted.- Specified by:
withGatewayConfigin interfaceTestGateway<TestStandaloneGateway>
-
gatewayConfig
Description copied from interface:TestGatewayReturns the gateway configuration for this node.- Specified by:
gatewayConfigin interfaceTestGateway<TestStandaloneGateway>
-
start
Description copied from interface:TestApplicationStarts the node in a blocking fashion.- Specified by:
startin interfaceTestApplication<T extends io.camunda.zeebe.qa.util.cluster.TestSpringApplication<T>>
-
stop
Description copied from interface:TestApplicationAttempts to stop the container gracefully in a blocking fashion.- Specified by:
stopin interfaceTestApplication<T extends io.camunda.zeebe.qa.util.cluster.TestSpringApplication<T>>
-
isStarted
public boolean isStarted()Description copied from interface:TestApplicationReturns whether the underlying application is started yet; does not include any probes- Specified by:
isStartedin interfaceTestApplication<T extends io.camunda.zeebe.qa.util.cluster.TestSpringApplication<T>>
-
withBean
Description copied from interface:TestApplicationWhen 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:
withBeanin interfaceTestApplication<T extends io.camunda.zeebe.qa.util.cluster.TestSpringApplication<T>>- Type Parameters:
V- the bean type- Parameters:
qualifier- the bean name/qualifierbean- the object to inject as the bean valuetype- the type to be resolved/autowired- Returns:
- itself for chaining
-
bean
Description copied from interface:TestApplicationIf the application is started (e.g.TestApplication.isStarted(), resolves and returns (i.e. auto-wires) the first bean of the given type.- Specified by:
beanin interfaceTestApplication<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
Description copied from interface:TestApplicationIf 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:
propertyin interfaceTestApplication<T extends io.camunda.zeebe.qa.util.cluster.TestSpringApplication<T>>- Type Parameters:
V- the expected property type type- Parameters:
property- the key identifying this propertytype- the expected type of the property valuefallback- a default value if the property is not set- Returns:
- the value of this (if any was resolved), or the fallback value
-
withProperty
Description copied from interface:TestApplicationConfigures Spring via properties. This does not work with properties that would be applied to injected beans (e.g. viaTestApplication.withBean(String, Object, Class)), since there will be property resolution for these beans.- Specified by:
withPropertyin interfaceTestApplication<T extends io.camunda.zeebe.qa.util.cluster.TestSpringApplication<T>>- Parameters:
key- the property keyvalue- the new value- Returns:
- itself for chaining
-
withAdditionalProfile
Description copied from interface:TestApplicationConfigures additional active Spring profiles.- Specified by:
withAdditionalProfilein interfaceTestApplication<T extends io.camunda.zeebe.qa.util.cluster.TestSpringApplication<T>>- Parameters:
profile- the profile ID- Returns:
- itself for chaining
-
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
-