File tree Expand file tree Collapse file tree 3 files changed +16
-19
lines changed
api/src/java/org/apache/solr/client/api/endpoint
core/src/test/org/apache/solr/handler/admin/api Expand file tree Collapse file tree 3 files changed +16
-19
lines changed Original file line number Diff line number Diff line change @@ -37,8 +37,7 @@ NodeHealthResponse healthcheck(
3737 description =
3838 "Maximum number of index generations a follower replica may lag behind its"
3939 + " leader before the health check reports FAILURE. Only relevant when"
40- + " running in legacy (non-SolrCloud) mode with leader/follower"
41- + " replication." )
40+ + " running in Standalone mode with leader/follower replication." )
4241 @ QueryParam ("maxGenerationLag" )
4342 Integer maxGenerationLag );
4443}
Original file line number Diff line number Diff line change 3131import org .junit .BeforeClass ;
3232import org .junit .Test ;
3333
34- public class NodeHealthTest extends SolrCloudTestCase {
34+ /**
35+ * Tests for the node-health API, on SolrCloud clusters
36+ *
37+ * @see NodeHealthStandaloneTest
38+ */
39+ public class NodeHealthSolrCloudTest extends SolrCloudTestCase {
3540
3641 @ BeforeClass
3742 public static void setupCluster () throws Exception {
@@ -77,10 +82,7 @@ public void testCloudMode_UnhealthyWhenZkClientClosed() throws Exception {
7782 SolrException e =
7883 assertThrows (SolrException .class , () -> new NodeApi .Healthcheck ().process (nodeClient ));
7984 assertEquals (ErrorCode .SERVICE_UNAVAILABLE .code , e .code ());
80- assertThat (
81- "Expected 'Host Unavailable' in exception message" ,
82- e .getMessage (),
83- containsString (("Host Unavailable" )));
85+ assertThat (e .getMessage (), containsString (("Host Unavailable" )));
8486 } finally {
8587 newJetty .stop ();
8688 }
@@ -119,10 +121,7 @@ public void testNotInLiveNodes_ThrowsServiceUnavailable() throws Exception {
119121 SolrException e =
120122 assertThrows (SolrException .class , () -> new NodeApi .Healthcheck ().process (nodeClient ));
121123 assertEquals (ErrorCode .SERVICE_UNAVAILABLE .code , e .code ());
122- assertThat (
123- "Expected 'Not in live nodes' in exception message" ,
124- e .getMessage (),
125- containsString ("Not in live nodes" ));
124+ assertThat (e .getMessage (), containsString ("Not in live nodes" ));
126125 } finally {
127126 newJetty .stop ();
128127 }
Original file line number Diff line number Diff line change 2828import org .junit .ClassRule ;
2929import org .junit .Test ;
3030
31+ /**
32+ * Tests for the node-health API, on Standalone Solr
33+ *
34+ * @see NodeHealthSolrCloudTest
35+ */
3136public class NodeHealthStandaloneTest extends SolrTestCaseJ4 {
3237
3338 @ ClassRule public static SolrJettyTestRule solrTestRule = new SolrJettyTestRule ();
@@ -45,10 +50,7 @@ public void testWithoutMaxGenerationLagReturnsOk() throws Exception {
4550
4651 assertNotNull (response );
4752 assertEquals (OK , response .status );
48- assertThat (
49- "Expected message about maxGenerationLag not being specified" ,
50- response .message ,
51- containsString ("maxGenerationLag isn't specified" ));
53+ assertThat (response .message , containsString ("maxGenerationLag isn't specified" ));
5254 }
5355
5456 @ Test
@@ -59,9 +61,6 @@ public void testWithNegativeMaxGenerationLagReturnsFailure() throws Exception {
5961
6062 assertNotNull (response );
6163 assertEquals (FAILURE , response .status );
62- assertThat (
63- "Expected message about invalid maxGenerationLag" ,
64- response .message ,
65- containsString ("Invalid value of maxGenerationLag" ));
64+ assertThat (response .message , containsString ("Invalid value of maxGenerationLag" ));
6665 }
6766}
You can’t perform that action at this time.
0 commit comments