Skip to content

Commit fc7c7cf

Browse files
committed
Responding to feedback
1 parent 3165c6e commit fc7c7cf

File tree

3 files changed

+16
-19
lines changed

3 files changed

+16
-19
lines changed

solr/api/src/java/org/apache/solr/client/api/endpoint/NodeHealthApi.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff 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
}

solr/core/src/test/org/apache/solr/handler/admin/api/NodeHealthTest.java renamed to solr/core/src/test/org/apache/solr/handler/admin/api/NodeHealthSolrCloudTest.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,12 @@
3131
import org.junit.BeforeClass;
3232
import 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
}

solr/core/src/test/org/apache/solr/handler/admin/api/NodeHealthStandaloneTest.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@
2828
import org.junit.ClassRule;
2929
import org.junit.Test;
3030

31+
/**
32+
* Tests for the node-health API, on Standalone Solr
33+
*
34+
* @see NodeHealthSolrCloudTest
35+
*/
3136
public 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
}

0 commit comments

Comments
 (0)