44import org .apache .solr .client .solrj .SolrServerException ;
55import org .apache .solr .client .solrj .impl .Http2SolrClient ;
66import org .apache .solr .client .solrj .response .SolrPingResponse ;
7- import org .junit .After ;
8- import org .junit .Test ;
9- import org .junit .runner .RunWith ;
10- import org .junit .runners .Parameterized ;
7+ import org .junit .jupiter .api .AfterEach ;
8+ import org .junit .jupiter .params .ParameterizedTest ;
9+ import org .junit .jupiter .params .provider .MethodSource ;
1110
1211import java .io .IOException ;
1312
1413import static org .assertj .core .api .Assertions .assertThat ;
1514
16- @ RunWith (Parameterized .class )
1715public class SolrContainerTest {
1816
19- @ Parameterized .Parameters (name = "{0}" )
17+ private SolrClient client = null ;
18+
2019 public static String [] getVersionsToTest () {
2120 return new String [] { "solr:8.11.4" , "solr:9.8.0" };
2221 }
2322
24- @ Parameterized .Parameter
25- public String solrImage ;
26-
27- private SolrClient client = null ;
28-
29- @ After
30- public void stopRestClient () throws IOException {
23+ @ AfterEach
24+ void stopRestClient () throws IOException {
3125 if (client != null ) {
3226 client .close ();
3327 client = null ;
3428 }
3529 }
3630
37- @ Test
38- public void solrCloudTest () throws IOException , SolrServerException {
31+ @ ParameterizedTest
32+ @ MethodSource ("getVersionsToTest" )
33+ void solrCloudTest (String solrImage ) throws IOException , SolrServerException {
3934 try (SolrContainer container = new SolrContainer (solrImage )) {
4035 container .start ();
4136 SolrPingResponse response = getClient (container ).ping ("dummy" );
@@ -44,8 +39,9 @@ public void solrCloudTest() throws IOException, SolrServerException {
4439 }
4540 }
4641
47- @ Test
48- public void solrStandaloneTest () throws IOException , SolrServerException {
42+ @ ParameterizedTest
43+ @ MethodSource ("getVersionsToTest" )
44+ void solrStandaloneTest (String solrImage ) throws IOException , SolrServerException {
4945 try (SolrContainer container = new SolrContainer (solrImage ).withZookeeper (false )) {
5046 container .start ();
5147 SolrPingResponse response = getClient (container ).ping ("dummy" );
@@ -54,8 +50,9 @@ public void solrStandaloneTest() throws IOException, SolrServerException {
5450 }
5551 }
5652
57- @ Test
58- public void solrCloudPingTest () throws IOException , SolrServerException {
53+ @ ParameterizedTest
54+ @ MethodSource ("getVersionsToTest" )
55+ void solrCloudPingTest (String solrImage ) throws IOException , SolrServerException {
5956 // solrContainerUsage {
6057 // Create the solr container.
6158 SolrContainer container = new SolrContainer (solrImage );
0 commit comments