diff --git a/core/src/test/java/org/elasticsearch/index/analysis/PreBuiltAnalyzerTests.java b/core/src/test/java/org/elasticsearch/index/analysis/PreBuiltAnalyzerTests.java index 13f30f288cc..06a242c8277 100644 --- a/core/src/test/java/org/elasticsearch/index/analysis/PreBuiltAnalyzerTests.java +++ b/core/src/test/java/org/elasticsearch/index/analysis/PreBuiltAnalyzerTests.java @@ -63,10 +63,14 @@ public class PreBuiltAnalyzerTests extends ESSingleNodeTestCase { } public void testThatInstancesAreCachedAndReused() { - assertThat(PreBuiltAnalyzers.ARABIC.getAnalyzer(Version.CURRENT), - is(PreBuiltAnalyzers.ARABIC.getAnalyzer(Version.CURRENT))); - assertThat(PreBuiltAnalyzers.ARABIC.getAnalyzer(Version.V_2_0_0), - is(PreBuiltAnalyzers.ARABIC.getAnalyzer(Version.V_2_2_0))); + assertSame(PreBuiltAnalyzers.ARABIC.getAnalyzer(Version.CURRENT), + PreBuiltAnalyzers.ARABIC.getAnalyzer(Version.CURRENT)); + // same lucene version should be cached + assertSame(PreBuiltAnalyzers.ARABIC.getAnalyzer(Version.V_2_0_0), + PreBuiltAnalyzers.ARABIC.getAnalyzer(Version.V_2_0_1)); + + assertNotSame(PreBuiltAnalyzers.ARABIC.getAnalyzer(Version.V_2_0_0), + PreBuiltAnalyzers.ARABIC.getAnalyzer(Version.V_2_2_0)); } public void testThatAnalyzersAreUsedInMapping() throws IOException {