Fix exception assertions in MetaDataStateFormatTests.testLoadState

Got broken with the change in #16850
This commit is contained in:
Boaz Leskes 2016-02-29 12:03:48 +01:00
parent 4602d8c0dc
commit e5e21480d4
1 changed files with 3 additions and 2 deletions

View File

@ -19,6 +19,7 @@
package org.elasticsearch.gateway;
import org.apache.lucene.codecs.CodecUtil;
import org.apache.lucene.index.CorruptIndexException;
import org.apache.lucene.store.ChecksumIndexInput;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.IOContext;
@ -27,6 +28,7 @@ import org.apache.lucene.store.MockDirectoryWrapper;
import org.apache.lucene.store.SimpleFSDirectory;
import org.apache.lucene.util.LuceneTestCase;
import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.ExceptionsHelper;
import org.elasticsearch.Version;
import org.elasticsearch.cluster.metadata.IndexMetaData;
import org.elasticsearch.cluster.metadata.MetaData;
@ -59,7 +61,6 @@ import java.util.Set;
import java.util.stream.StreamSupport;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.notNullValue;
@ -377,7 +378,7 @@ public class MetaDataStateFormatTests extends ESTestCase {
format.loadLatestState(logger, dirList.toArray(new Path[0]));
fail("latest version can not be read");
} catch (ElasticsearchException ex) {
assertThat(ex.getCause(), instanceOf(CorruptStateException.class));
assertThat(ExceptionsHelper.unwrap(ex, CorruptIndexException.class), notNullValue());
}
}