Skip to content

Commit bde2a63

Browse files
committed
tests
1 parent d0ab40e commit bde2a63

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

server/src/internalClusterTest/java/org/elasticsearch/action/admin/cluster/allocation/ClusterAllocationExplainIT.java

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -461,12 +461,10 @@ public void testAllocationFilteringOnIndexCreation() throws Exception {
461461
for (Decision d : result.getCanAllocateDecision().getDecisions()) {
462462
if (d.label().equals("filter")) {
463463
assertEquals(Decision.Type.NO, d.type());
464-
assertEquals(
465-
"node does not match index setting [index.routing.allocation.include] filters [_name:\"non_existent_node\"]; for more information, see ["
466-
+ ReferenceDocs.ALLOCATION_EXPLAIN_SETTING_CONFLICT
467-
+ "]",
468-
d.getExplanation()
469-
);
464+
assertEquals(Strings.format("""
465+
node does not match index setting [index.routing.allocation.include] \
466+
filters [_name:\"non_existent_node\"]; for more information, see [%s]\
467+
""", ReferenceDocs.ALLOCATION_EXPLAIN_SETTING_CONFLICT), d.getExplanation());
470468
}
471469
}
472470
}
@@ -554,9 +552,12 @@ public void testAllocationFilteringPreventsShardMove() throws Exception {
554552
if (d.label().equals("filter")) {
555553
assertEquals(Decision.Type.NO, d.type());
556554
assertEquals(
557-
"node does not match index setting [index.routing.allocation.include] filters [_name:\"non_existent_node\"]; for more information, see ["
558-
+ ReferenceDocs.ALLOCATION_EXPLAIN_SETTING_CONFLICT
559-
+ "]",
555+
Strings.format(
556+
"""
557+
node does not match index setting [index.routing.allocation.include] \
558+
filters [_name:\"non_existent_node\"]; for more information, see [%s]""",
559+
ReferenceDocs.ALLOCATION_EXPLAIN_SETTING_CONFLICT
560+
),
560561
d.getExplanation()
561562
);
562563
} else {
@@ -579,9 +580,12 @@ public void testAllocationFilteringPreventsShardMove() throws Exception {
579580
if (d.label().equals("filter")) {
580581
assertEquals(Decision.Type.NO, d.type());
581582
assertEquals(
582-
"node does not match index setting [index.routing.allocation.include] filters [_name:\"non_existent_node\"]; for more information, see ["
583-
+ ReferenceDocs.ALLOCATION_EXPLAIN_SETTING_CONFLICT
584-
+ "]",
583+
Strings.format(
584+
"""
585+
node does not match index setting [index.routing.allocation.include] \
586+
filters [_name:\"non_existent_node\"]; for more information, see [%s]""",
587+
ReferenceDocs.ALLOCATION_EXPLAIN_SETTING_CONFLICT
588+
),
585589
d.getExplanation()
586590
);
587591
} else {
@@ -893,8 +897,8 @@ public void testBetterBalanceButCannotAllocate() throws Exception {
893897
assertEquals(
894898
Strings.format(
895899
"""
896-
node does not match index setting [index.routing.allocation.include] filters [_name:"%s"]; for more information, see [%s]\
897-
""",
900+
node does not match index setting [index.routing.allocation.include] \
901+
filters [_name:"%s"]; for more information, see [%s]""",
898902
primaryNodeName,
899903
ReferenceDocs.ALLOCATION_EXPLAIN_SETTING_CONFLICT
900904
),

0 commit comments

Comments
 (0)