66import org .apache .solr .client .solrj .response .SolrPingResponse ;
77import org .junit .After ;
88import org .junit .Test ;
9+ import org .junit .runner .RunWith ;
10+ import org .junit .runners .Parameterized ;
911import org .testcontainers .utility .DockerImageName ;
1012
1113import java .io .IOException ;
1214
1315import static org .assertj .core .api .Assertions .assertThat ;
1416
17+ @ RunWith (Parameterized .class )
1518public class SolrContainerTest {
1619
17- private static final DockerImageName SOLR_IMAGE = DockerImageName .parse ("solr:8.3.0" );
20+ @ Parameterized .Parameters (name = "{0}" )
21+ public static DockerImageName [] getVersionsToTest () {
22+ return new DockerImageName [] {
23+ DockerImageName .parse ("solr:8.11.4" ),
24+ DockerImageName .parse ("solr:9.8.0" )
25+ };
26+ }
27+
28+ @ Parameterized .Parameter
29+ public DockerImageName solrImage ;
1830
1931 private SolrClient client = null ;
2032
@@ -28,7 +40,7 @@ public void stopRestClient() throws IOException {
2840
2941 @ Test
3042 public void solrCloudTest () throws IOException , SolrServerException {
31- try (SolrContainer container = new SolrContainer (SOLR_IMAGE )) {
43+ try (SolrContainer container = new SolrContainer (solrImage )) {
3244 container .start ();
3345 SolrPingResponse response = getClient (container ).ping ("dummy" );
3446 assertThat (response .getStatus ()).isZero ();
@@ -38,7 +50,7 @@ public void solrCloudTest() throws IOException, SolrServerException {
3850
3951 @ Test
4052 public void solrStandaloneTest () throws IOException , SolrServerException {
41- try (SolrContainer container = new SolrContainer (SOLR_IMAGE ).withZookeeper (false )) {
53+ try (SolrContainer container = new SolrContainer (solrImage ).withZookeeper (false )) {
4254 container .start ();
4355 SolrPingResponse response = getClient (container ).ping ("dummy" );
4456 assertThat (response .getStatus ()).isZero ();
@@ -50,7 +62,7 @@ public void solrStandaloneTest() throws IOException, SolrServerException {
5062 public void solrCloudPingTest () throws IOException , SolrServerException {
5163 // solrContainerUsage {
5264 // Create the solr container.
53- SolrContainer container = new SolrContainer (SOLR_IMAGE );
65+ SolrContainer container = new SolrContainer (solrImage );
5466
5567 // Start the container. This step might take some time...
5668 container .start ();
0 commit comments