66import org .apache .solr .client .solrj .response .SolrPingResponse ;
77import org .junit .After ;
88import org .junit .Test ;
9- import org .testcontainers .utility .DockerImageName ;
9+ import org .junit .runner .RunWith ;
10+ import org .junit .runners .Parameterized ;
1011
1112import java .io .IOException ;
1213
1314import static org .assertj .core .api .Assertions .assertThat ;
1415
16+ @ RunWith (Parameterized .class )
1517public class SolrContainerTest {
1618
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 ;
1826
1927 private SolrClient client = null ;
2028
@@ -28,7 +36,7 @@ public void stopRestClient() throws IOException {
2836
2937 @ Test
3038 public void solrCloudTest () throws IOException , SolrServerException {
31- try (SolrContainer container = new SolrContainer (SOLR_IMAGE )) {
39+ try (SolrContainer container = new SolrContainer (solrImage )) {
3240 container .start ();
3341 SolrPingResponse response = getClient (container ).ping ("dummy" );
3442 assertThat (response .getStatus ()).isZero ();
@@ -38,7 +46,7 @@ public void solrCloudTest() throws IOException, SolrServerException {
3846
3947 @ Test
4048 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 )) {
4250 container .start ();
4351 SolrPingResponse response = getClient (container ).ping ("dummy" );
4452 assertThat (response .getStatus ()).isZero ();
@@ -50,7 +58,7 @@ public void solrStandaloneTest() throws IOException, SolrServerException {
5058 public void solrCloudPingTest () throws IOException , SolrServerException {
5159 // solrContainerUsage {
5260 // Create the solr container.
53- SolrContainer container = new SolrContainer (SOLR_IMAGE );
61+ SolrContainer container = new SolrContainer (solrImage );
5462
5563 // Start the container. This step might take some time...
5664 container .start ();
0 commit comments