20
20
import com .azure .storage .blob .BlobContainerClient ;
21
21
import com .azure .storage .blob .BlobContainerClientBuilder ;
22
22
import com .azure .storage .blob .models .BlobItem ;
23
+ import io .github .sgtsilvio .gradle .oci .junit .jupiter .OciImages ;
23
24
import org .jetbrains .annotations .NotNull ;
24
25
import org .junit .jupiter .api .AfterEach ;
25
26
import org .junit .jupiter .api .BeforeEach ;
40
41
import java .util .concurrent .TimeoutException ;
41
42
import java .util .stream .Collectors ;
42
43
43
- import static com .hivemq .extensions .cluster .discovery .azure .DockerImageNames .*;
44
44
import static java .util .concurrent .TimeUnit .SECONDS ;
45
45
import static org .awaitility .Awaitility .await ;
46
- import static org .junit .jupiter .api .Assertions .*;
46
+ import static org .junit .jupiter .api .Assertions .assertEquals ;
47
+ import static org .junit .jupiter .api .Assertions .assertFalse ;
48
+ import static org .junit .jupiter .api .Assertions .assertTrue ;
47
49
48
50
@ SuppressWarnings ("resource" )
49
51
class AzureDiscoveryExtensionIT {
@@ -54,10 +56,11 @@ class AzureDiscoveryExtensionIT {
54
56
private static final @ NotNull String BLOB_CONTAINER_NAME = "hivemq-discovery" ;
55
57
56
58
private final @ NotNull Network network = Network .newNetwork ();
57
- private final @ NotNull GenericContainer <?> azureriteContainer = new GenericContainer <>(AZURITE_IMAGE ) //
58
- .withExposedPorts (AZURITE_PORT ) //
59
- .withNetwork (network ) //
60
- .withNetworkAliases (AZURITE_NETWORK_ALIAS );
59
+ private final @ NotNull GenericContainer <?> azureriteContainer =
60
+ new GenericContainer <>(OciImages .getImageName ("azure-storage/azurite" )) //
61
+ .withExposedPorts (AZURITE_PORT ) //
62
+ .withNetwork (network ) //
63
+ .withNetworkAliases (AZURITE_NETWORK_ALIAS );
61
64
62
65
@ BeforeEach
63
66
void setUp () {
@@ -116,7 +119,8 @@ void twoNodesInCluster_oneNodeStarted_threeNodesInCluster() throws IOException,
116
119
117
120
@ Test
118
121
void twoNodesInCluster_oneNodeCannotReachAzure_nodeFileDeleted () throws IOException , TimeoutException {
119
- final ToxiproxyContainer toxiproxy = new ToxiproxyContainer (TOXIPROXY_IMAGE ).withNetwork (network ).withNetworkAliases (TOXIPROXY_NETWORK_ALIAS );
122
+ final ToxiproxyContainer toxiproxy = new ToxiproxyContainer (OciImages .getImageName ("shopify/toxiproxy" )) //
123
+ .withNetwork (network ).withNetworkAliases (TOXIPROXY_NETWORK_ALIAS );
120
124
try (toxiproxy ) {
121
125
toxiproxy .start ();
122
126
@@ -272,7 +276,7 @@ void containerExisting_nodeStarted_containerUsed() throws IOException {
272
276
final Path configFile = Files .createTempDirectory ("az-extension-test" ).resolve ("azDiscovery.properties" );
273
277
Files .writeString (configFile , createConfig (connectionString ));
274
278
275
- return new HiveMQContainer (HIVEMQ_IMAGE ) //
279
+ return new HiveMQContainer (OciImages . getImageName ( "hivemq/hivemq4" ) ) //
276
280
.withHiveMQConfig (MountableFile .forClasspathResource ("config.xml" ))
277
281
.withExtension (MountableFile .forClasspathResource ("hivemq-azure-cluster-discovery-extension" ))
278
282
.withFileInExtensionHomeFolder (MountableFile .forHostPath (configFile ),
@@ -283,4 +287,4 @@ void containerExisting_nodeStarted_containerUsed() throws IOException {
283
287
private @ NotNull HiveMQContainer createHiveMQNode () throws IOException {
284
288
return createHiveMQNode (createDockerAzuriteConnectionString ());
285
289
}
286
- }
290
+ }
0 commit comments