mirror of https://github.com/apache/lucene.git
SOLR-9445: Fix failures in TestLocalFSCloudBackupRestore due to changed code path which return SolrExceptions instead of SolrServerExceptions
(cherry picked from commit df9a642
)
This commit is contained in:
parent
545ce38714
commit
7cf7bfdf0c
|
@ -33,6 +33,7 @@ import org.apache.solr.client.solrj.impl.HttpSolrClient.RemoteSolrException;
|
|||
import org.apache.solr.client.solrj.request.CollectionAdminRequest;
|
||||
import org.apache.solr.client.solrj.request.CollectionAdminRequest.ClusterProp;
|
||||
import org.apache.solr.client.solrj.response.RequestStatusState;
|
||||
import org.apache.solr.common.SolrException;
|
||||
import org.apache.solr.common.SolrException.ErrorCode;
|
||||
import org.apache.solr.common.SolrInputDocument;
|
||||
import org.apache.solr.common.cloud.DocCollection;
|
||||
|
@ -147,9 +148,8 @@ public abstract class AbstractCloudBackupRestoreTestCase extends SolrCloudTestCa
|
|||
try {
|
||||
backup.process(solrClient);
|
||||
fail("This request should have failed since the cluster property value for backup location property is invalid.");
|
||||
} catch (SolrServerException ex) {
|
||||
assertTrue(ex.getCause() instanceof RemoteSolrException);
|
||||
assertEquals(ErrorCode.SERVER_ERROR.code, ((RemoteSolrException)ex.getCause()).code());
|
||||
} catch (SolrException ex) {
|
||||
assertEquals(ErrorCode.SERVER_ERROR.code, ex.code());
|
||||
}
|
||||
|
||||
String restoreCollectionName = collectionName + "_invalidrequest";
|
||||
|
@ -158,9 +158,8 @@ public abstract class AbstractCloudBackupRestoreTestCase extends SolrCloudTestCa
|
|||
try {
|
||||
restore.process(solrClient);
|
||||
fail("This request should have failed since the cluster property value for backup location property is invalid.");
|
||||
} catch (SolrServerException ex) {
|
||||
assertTrue(ex.getCause() instanceof RemoteSolrException);
|
||||
assertEquals(ErrorCode.SERVER_ERROR.code, ((RemoteSolrException)ex.getCause()).code());
|
||||
} catch (SolrException ex) {
|
||||
assertEquals(ErrorCode.SERVER_ERROR.code, ex.code());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue