HiveMQ Testcontainer 1.2.0 Released

HiveMQ Testcontainer 1.2.0 Released

author Yannick Weber

Written by Yannick Weber

Category: HiveMQ Testing Test Container MQTT Client

Published: September 2, 2020

HiveMQ Testcontainer 1.2.0

The HiveMQ team is pleased to announce the release of HiveMQ Testcontainer 1.2.0. This new version adds the following improvements:

  • Explicit waiting for the startup of extensions
  • Improved wait strategy for HiveMQ startup

Waiting for extension startups

By default, the HiveMQ Testcontainer waits for the HiveMQ startup log message. Now, you can define additional wait conditions for your HiveMQ Extensions:

JUnit 4

1
2
3
4
5
6
@Rule
public final @NotNull HiveMQTestContainerRule rule =
        new HiveMQTestContainerRule()
            .withExtension(new File("src/test/resources/modifier-extension"))
            .waitForExtension("My Extension Name");
            

JUnit 5

1
2
3
4
5
6
@RegisterExtension
public final @NotNull HiveMQTestContainerExtension extension =
        new HiveMQTestContainerExtension()
            .withExtension(new File("src/test/resources/modifier-extension"))
            .waitForExtension("My Extension Name");
            

JUnit 4

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
private final @NotNull HiveMQExtension hiveMQExtension = HiveMQExtension.builder()
    .id("extension-1")
    .name("my-extension")
    .version("1.0")
    .mainClass(MyExtension.class).build();

@Rule
public final @NotNull HiveMQTestContainerRule rule =
    new HiveMQTestContainerRule("hivemq/hivemq4", "latest")
    .withExtension(hiveMQExtension)
    .waitForExtension(hiveMQExtension);
    

JUnit 5

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
private final @NotNull HiveMQExtension hiveMQExtension = HiveMQExtension.builder()
    .id("extension-1")
    .name("my-extension")
    .version("1.0")
    .mainClass(MyExtension.class).build();

@RegisterExtension
public final @NotNull HiveMQTestContainerExtension extension =
    new HiveMQTestContainerExtension("hivemq/hivemq4", "latest")
    .withExtension(hiveMQExtension)
    .waitForExtension(hiveMQExtension);
    
author Yannick Weber

About Yannick Weber

Yannick is a Senior Software Engineer and one of the core members of HiveMQ’s product development team. He is focusing on quality development of HiveMQ’s many tools and extensions. In addition, he is the maintainer of the HiveMQ module in the testcontainers-java project.

mail icon Contact Yannick
newer posts Automate your HiveMQ installation with Concourse and Terraform
HiveMQ Kubernetes Operator EAP older posts