Class IotConfig
java.lang.Object
io.floci.testcontainers.config.services.AbstractServiceConfig<IotConfig.Builder>
io.floci.testcontainers.config.services.IotConfig
Configuration for IoT Core-specific container settings, including the embedded MQTT broker.
Instances are created via IotConfig.Builder:
IotConfig config = IotConfig.builder()
.mqttAutoStart(true)
.mqttPort(1883)
.build();
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class io.floci.testcontainers.config.services.AbstractServiceConfig
DEFAULT_ENABLED -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyEnvVarsToContainer(org.testcontainers.containers.Container<?> container) Applies this service configuration to the given container by setting the appropriate environment variables.voidapplyExposedPortsToContainer(org.testcontainers.containers.Container<?> container) Applies this service configuration to the given container by exposing the appropriate ports.static IotConfig.Builderbuilder()Returns a newIotConfig.Builderfor this configuration.Returns the bind address for the embedded MQTT broker.intReturns the port used by the embedded MQTT broker.booleanReturns whether the embedded MQTT broker starts automatically on container startup rather than lazily on the first MQTT connection.booleanReturns whether the embedded MQTT broker is enabled.Returns a newIotConfig.Builderfor this configuration, initialized with the current values of this instance.Methods inherited from class io.floci.testcontainers.config.services.AbstractServiceConfig
isEnabled
-
Method Details
-
builder
Returns a newIotConfig.Builderfor this configuration.- Returns:
- a new builder
-
toBuilder
Returns a newIotConfig.Builderfor this configuration, initialized with the current values of this instance.- Specified by:
toBuilderin classAbstractServiceConfig<IotConfig.Builder>- Returns:
- a new builder pre-populated with this configuration's values
-
isMqttEnabled
public boolean isMqttEnabled()Returns whether the embedded MQTT broker is enabled.- Returns:
trueif the MQTT broker is enabled
-
isMqttAutoStart
public boolean isMqttAutoStart()Returns whether the embedded MQTT broker starts automatically on container startup rather than lazily on the first MQTT connection.- Returns:
trueif the MQTT broker auto-starts
-
getMqttHost
Returns the bind address for the embedded MQTT broker.- Returns:
- the MQTT broker host
-
getMqttPort
public int getMqttPort()Returns the port used by the embedded MQTT broker.- Returns:
- the MQTT broker port
-
applyEnvVarsToContainer
public void applyEnvVarsToContainer(org.testcontainers.containers.Container<?> container) Description copied from class:AbstractServiceConfigApplies this service configuration to the given container by setting the appropriate environment variables.- Overrides:
applyEnvVarsToContainerin classAbstractServiceConfig<IotConfig.Builder>- Parameters:
container- the container to configure
-
applyExposedPortsToContainer
public void applyExposedPortsToContainer(org.testcontainers.containers.Container<?> container) Description copied from class:AbstractServiceConfigApplies this service configuration to the given container by exposing the appropriate ports.- Overrides:
applyExposedPortsToContainerin classAbstractServiceConfig<IotConfig.Builder>- Parameters:
container- the container to configure
-