diff --git a/solr/core/src/test/org/apache/solr/cloud/AbstractCloudBackupRestoreTestCase.java b/solr/core/src/test/org/apache/solr/cloud/AbstractCloudBackupRestoreTestCase.java index fd74eaf06f7..8e7a4b021dd 100644 --- a/solr/core/src/test/org/apache/solr/cloud/AbstractCloudBackupRestoreTestCase.java +++ b/solr/core/src/test/org/apache/solr/cloud/AbstractCloudBackupRestoreTestCase.java @@ -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()); } }