1
1
package org .testcontainers .hivemq ;
2
2
3
+ import org .jetbrains .annotations .NotNull ;
3
4
import org .junit .jupiter .api .Test ;
4
5
import org .junit .jupiter .api .Timeout ;
6
+ import org .junit .jupiter .params .ParameterizedTest ;
7
+ import org .junit .jupiter .params .provider .ValueSource ;
5
8
import org .slf4j .event .Level ;
6
9
import org .testcontainers .hivemq .util .TestPublishModifiedUtil ;
7
10
import org .testcontainers .utility .DockerImageName ;
11
14
12
15
class ContainerWithExtensionFromDirectoryIT {
13
16
14
- @ Test
17
+ @ ParameterizedTest
18
+ @ ValueSource (
19
+ strings = {
20
+ "2020.1" , // first version that provided a container image
21
+ "2024.3" , // version that runs the image as a non-root user by default
22
+ }
23
+ )
15
24
@ Timeout (value = 3 , unit = TimeUnit .MINUTES )
16
- void test () throws Exception {
25
+ void test (final @ NotNull String hivemqCeTag ) throws Exception {
17
26
try (
18
27
final HiveMQContainer hivemq = new HiveMQContainer (
19
- DockerImageName .parse ("hivemq/hivemq-ce" ).withTag ("2021.3" )
28
+ DockerImageName .parse ("hivemq/hivemq-ce" ).withTag (hivemqCeTag )
20
29
)
21
30
.withExtension (MountableFile .forClasspathResource ("/modifier-extension" ))
22
31
.waitForExtension ("Modifier Extension" )
@@ -33,7 +42,7 @@ void test() throws Exception {
33
42
void test_wrongDirectoryName () throws Exception {
34
43
try (
35
44
final HiveMQContainer hivemq = new HiveMQContainer (
36
- DockerImageName .parse ("hivemq/hivemq-ce" ).withTag ("2021 .3" )
45
+ DockerImageName .parse ("hivemq/hivemq-ce" ).withTag ("2024 .3" )
37
46
)
38
47
.withExtension (MountableFile .forClasspathResource ("/modifier-extension-wrong-name" ))
39
48
.waitForExtension ("Modifier Extension" )
0 commit comments