6
6
import org .apache .solr .client .solrj .response .SolrPingResponse ;
7
7
import org .junit .After ;
8
8
import org .junit .Test ;
9
- import org .testcontainers .utility .DockerImageName ;
9
+ import org .junit .runner .RunWith ;
10
+ import org .junit .runners .Parameterized ;
10
11
11
12
import java .io .IOException ;
12
13
13
14
import static org .assertj .core .api .Assertions .assertThat ;
14
15
16
+ @ RunWith (Parameterized .class )
15
17
public class SolrContainerTest {
16
18
17
- private static final DockerImageName SOLR_IMAGE = DockerImageName .parse ("solr:8.3.0" );
19
+ @ Parameterized .Parameters (name = "{0}" )
20
+ public static String [] getVersionsToTest () {
21
+ return new String [] { "solr:8.11.4" , "solr:9.8.0" };
22
+ }
23
+
24
+ @ Parameterized .Parameter
25
+ public String solrImage ;
18
26
19
27
private SolrClient client = null ;
20
28
@@ -28,7 +36,7 @@ public void stopRestClient() throws IOException {
28
36
29
37
@ Test
30
38
public void solrCloudTest () throws IOException , SolrServerException {
31
- try (SolrContainer container = new SolrContainer (SOLR_IMAGE )) {
39
+ try (SolrContainer container = new SolrContainer (solrImage )) {
32
40
container .start ();
33
41
SolrPingResponse response = getClient (container ).ping ("dummy" );
34
42
assertThat (response .getStatus ()).isZero ();
@@ -38,7 +46,7 @@ public void solrCloudTest() throws IOException, SolrServerException {
38
46
39
47
@ Test
40
48
public void solrStandaloneTest () throws IOException , SolrServerException {
41
- try (SolrContainer container = new SolrContainer (SOLR_IMAGE ).withZookeeper (false )) {
49
+ try (SolrContainer container = new SolrContainer (solrImage ).withZookeeper (false )) {
42
50
container .start ();
43
51
SolrPingResponse response = getClient (container ).ping ("dummy" );
44
52
assertThat (response .getStatus ()).isZero ();
@@ -50,7 +58,7 @@ public void solrStandaloneTest() throws IOException, SolrServerException {
50
58
public void solrCloudPingTest () throws IOException , SolrServerException {
51
59
// solrContainerUsage {
52
60
// Create the solr container.
53
- SolrContainer container = new SolrContainer (SOLR_IMAGE );
61
+ SolrContainer container = new SolrContainer (solrImage );
54
62
55
63
// Start the container. This step might take some time...
56
64
container .start ();
0 commit comments