Apache Lucene open-source search software
SOLR-9087: avoid IndexOutOfBoundsException in TestReplicationHandler.doTestIndexAndConfigAliasReplication
Christine Poerschkea5d785a8e92d
diff --git a/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java b/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.javaindex 87b99411a18..b9bcf7b254b 100644--- a/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java+++ b/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java@@ -1323,7 +1323,9 @@ public class TestReplicationHandler extends SolrTestCaseJ4 {slaveClient.commit();slaveQueryRsp = rQuery(1, "id:2001", slaveClient);- SolrDocument d = ((SolrDocumentList) slaveQueryRsp.get("response")).get(0);+ final SolrDocumentList sdl = (SolrDocumentList) slaveQueryRsp.get("response");+ assertEquals(1, sdl.getNumFound());+ final SolrDocument d = sdl.get(0);assertEquals("n2001", (String) d.getFieldValue("newname"));checkForSingleIndex(masterJetty);