From f9732365883e15f774b26c489cd9d3af6ca6d150 Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Sat, 20 May 2023 23:49:45 +0200 Subject: [PATCH] Test code cleanup. Original Pull Request #2572 Closes #2571 --- .../NewElasticsearchClientDevelopment.java | 32 ------------------- .../core/geo/GeoELCIntegrationTests.java | 5 --- .../core/geo/GeoIntegrationTests.java | 14 +------- .../IndexTemplateELCIntegrationTests.java | 7 +--- .../index/IndexTemplateIntegrationTests.java | 17 +--------- .../MappingBuilderELCIntegrationTests.java | 5 --- .../index/MappingBuilderIntegrationTests.java | 4 +-- ...iveIndexOperationsELCIntegrationTests.java | 5 --- ...activeIndexOperationsIntegrationTests.java | 8 +---- ...ctiveIndexTemplateELCIntegrationTests.java | 5 --- ...ReactiveIndexTemplateIntegrationTests.java | 16 +--------- .../CompletionELCIntegrationTests.java | 5 --- .../suggest/CompletionIntegrationTests.java | 3 +- .../ReactiveSuggestELCIntegrationTests.java | 5 --- .../ReactiveSuggestIntegrationTests.java | 3 +- ...omMethodRepositoryELCIntegrationTests.java | 5 --- ...ustomMethodRepositoryIntegrationTests.java | 10 +----- 17 files changed, 9 insertions(+), 140 deletions(-) delete mode 100644 src/test/java/org/springframework/data/elasticsearch/NewElasticsearchClientDevelopment.java diff --git a/src/test/java/org/springframework/data/elasticsearch/NewElasticsearchClientDevelopment.java b/src/test/java/org/springframework/data/elasticsearch/NewElasticsearchClientDevelopment.java deleted file mode 100644 index 4b8a43d09..000000000 --- a/src/test/java/org/springframework/data/elasticsearch/NewElasticsearchClientDevelopment.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2021-2023 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.springframework.data.elasticsearch; - -/** - * TODO remove when the new Elasticsearch client is fully working and the old client is removed - * - * @author Peter-Josef Meisch - */ -public interface NewElasticsearchClientDevelopment { - - default boolean newElasticsearchClient() { - return false; - } - - default boolean oldElasticsearchClient() { - return !newElasticsearchClient(); - } -} diff --git a/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoELCIntegrationTests.java index 4179db677..74221d9a9 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoELCIntegrationTests.java @@ -45,11 +45,6 @@ public class GeoELCIntegrationTests extends GeoIntegrationTests { } } - @Override - public boolean newElasticsearchClient() { - return true; - } - @Override protected Query nativeQueryForBoundingBox(String fieldName, double top, double left, double bottom, double right) { return NativeQuery.builder() // diff --git a/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoIntegrationTests.java index 4ba985c30..1135f1b8e 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoIntegrationTests.java @@ -26,7 +26,6 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.DisabledIf; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.annotation.Id; -import org.springframework.data.elasticsearch.NewElasticsearchClientDevelopment; import org.springframework.data.elasticsearch.annotations.Document; import org.springframework.data.elasticsearch.annotations.GeoPointField; import org.springframework.data.elasticsearch.core.AbstractElasticsearchTemplate; @@ -56,16 +55,11 @@ import org.springframework.lang.Nullable; * Latitude , max Longitude , max Latitude */ @SpringIntegrationTest -public abstract class GeoIntegrationTests implements NewElasticsearchClientDevelopment { +public abstract class GeoIntegrationTests { @Autowired private ElasticsearchOperations operations; @Autowired private IndexNameProvider indexNameProvider; - boolean rhlcWithCluster8() { - var clusterVersion = ((AbstractElasticsearchTemplate) operations).getClusterVersion(); - return (oldElasticsearchClient() && clusterVersion != null && clusterVersion.startsWith("8")); - } - @BeforeEach public void before() { indexNameProvider.increment(); @@ -227,7 +221,6 @@ public abstract class GeoIntegrationTests implements NewElasticsearchClientDevel assertThat(geoAuthorsForGeoCriteria).hasSize(3); } - @DisabledIf(value = "rhlcWithCluster8", disabledReason = "RHLC fails to parse response from ES 8.2") @Test public void shouldFindAllMarkersForNativeSearchQuery() { @@ -245,7 +238,6 @@ public abstract class GeoIntegrationTests implements NewElasticsearchClientDevel protected abstract Query nativeQueryForBoundingBox(String fieldName, double top, double left, double bottom, double right); - @DisabledIf(value = "rhlcWithCluster8", disabledReason = "RHLC fails to parse response from ES 8.2") @Test public void shouldFindAuthorMarkersInBoxForGivenCriteriaQueryUsingGeoBox() { @@ -264,7 +256,6 @@ public abstract class GeoIntegrationTests implements NewElasticsearchClientDevel .containsExactlyInAnyOrder("def", "ghi"); } - @DisabledIf(value = "rhlcWithCluster8", disabledReason = "RHLC fails to parse response from ES 8.2") @Test public void shouldFindAuthorMarkersInBoxForGivenCriteriaQueryUsingGeohash() { @@ -283,7 +274,6 @@ public abstract class GeoIntegrationTests implements NewElasticsearchClientDevel .containsExactlyInAnyOrder("def", "ghi"); } - @DisabledIf(value = "rhlcWithCluster8", disabledReason = "RHLC fails to parse response from ES 8.2") @Test public void shouldFindAuthorMarkersInBoxForGivenCriteriaQueryUsingGeoPoints() { @@ -302,7 +292,6 @@ public abstract class GeoIntegrationTests implements NewElasticsearchClientDevel .containsExactlyInAnyOrder("def", "ghi"); } - @DisabledIf(value = "rhlcWithCluster8", disabledReason = "RHLC fails to parse response from ES 8.2") @Test public void shouldFindAuthorMarkersInBoxForGivenCriteriaQueryUsingPoints() { @@ -321,7 +310,6 @@ public abstract class GeoIntegrationTests implements NewElasticsearchClientDevel .containsExactlyInAnyOrder("def", "ghi"); } - @DisabledIf(value = "rhlcWithCluster8", disabledReason = "RHLC fails to parse response from ES 8.2") @Test public void shouldFindLocationWithGeoHashPrefix() { diff --git a/src/test/java/org/springframework/data/elasticsearch/core/index/IndexTemplateELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/index/IndexTemplateELCIntegrationTests.java index f0bac0ef3..9ef028bc1 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/index/IndexTemplateELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/index/IndexTemplateELCIntegrationTests.java @@ -23,9 +23,4 @@ import org.springframework.test.context.ContextConfiguration; * @since 4.4 */ @ContextConfiguration(classes = { ElasticsearchTemplateConfiguration.class }) -public class IndexTemplateELCIntegrationTests extends IndexTemplateIntegrationTests { - @Override - public boolean newElasticsearchClient() { - return true; - } -} +public class IndexTemplateELCIntegrationTests extends IndexTemplateIntegrationTests { } diff --git a/src/test/java/org/springframework/data/elasticsearch/core/index/IndexTemplateIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/index/IndexTemplateIntegrationTests.java index 8d16126de..fd9ad924d 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/index/IndexTemplateIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/index/IndexTemplateIntegrationTests.java @@ -25,15 +25,12 @@ import java.util.UUID; import org.json.JSONException; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.condition.DisabledIf; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.annotation.Id; -import org.springframework.data.elasticsearch.NewElasticsearchClientDevelopment; import org.springframework.data.elasticsearch.annotations.Document; import org.springframework.data.elasticsearch.annotations.Field; import org.springframework.data.elasticsearch.annotations.FieldType; import org.springframework.data.elasticsearch.annotations.Setting; -import org.springframework.data.elasticsearch.core.AbstractElasticsearchTemplate; import org.springframework.data.elasticsearch.core.ElasticsearchOperations; import org.springframework.data.elasticsearch.core.IndexOperations; import org.springframework.data.elasticsearch.core.mapping.IndexCoordinates; @@ -47,16 +44,10 @@ import org.springframework.lang.Nullable; * @author Peter-Josef Meisch */ @SpringIntegrationTest -public abstract class IndexTemplateIntegrationTests implements NewElasticsearchClientDevelopment { +public abstract class IndexTemplateIntegrationTests { @Autowired ElasticsearchOperations operations; - boolean rhlcWithCluster8() { - var clusterVersion = ((AbstractElasticsearchTemplate) operations).getClusterVersion(); - return (oldElasticsearchClient() && clusterVersion != null && clusterVersion.startsWith("8")); - } - - @DisabledIf(value = "rhlcWithCluster8", disabledReason = "RHLC fails to parse response from ES 8.2") @Test // DATAES-612 void shouldPutTemplate() { @@ -78,7 +69,6 @@ public abstract class IndexTemplateIntegrationTests implements NewElasticsearchC assertThat(acknowledged).isTrue(); } - @DisabledIf(value = "oldElasticsearchClient", disabledReason = "not implemented for the deprecated old client") @Test // #1458 @DisplayName("should create component template") void shouldCreateComponentTemplate() { @@ -108,7 +98,6 @@ public abstract class IndexTemplateIntegrationTests implements NewElasticsearchC assertThat(acknowledged).isTrue(); } - @DisabledIf(value = "oldElasticsearchClient", disabledReason = "not implemented for the deprecated old client") @Test // #1458 @DisplayName("should get component template") void shouldGetComponentTemplate() throws JSONException { @@ -157,7 +146,6 @@ public abstract class IndexTemplateIntegrationTests implements NewElasticsearchC assertThat(alias2.getAlias()).isEqualTo("alias2"); } - @DisabledIf(value = "oldElasticsearchClient", disabledReason = "not implemented for the deprecated old client") @Test // #1458 @DisplayName("should delete component template") void shouldDeleteComponentTemplate() { @@ -185,7 +173,6 @@ public abstract class IndexTemplateIntegrationTests implements NewElasticsearchC assertThat(exists).isFalse(); } - @DisabledIf(value = "oldElasticsearchClient", disabledReason = "not implemented for the deprecated old client") @Test // #1458 @DisplayName("should put, get and delete index template with template") void shouldPutGetAndDeleteIndexTemplateWithTemplate() { @@ -225,7 +212,6 @@ public abstract class IndexTemplateIntegrationTests implements NewElasticsearchC assertThat(exists).isFalse(); } - @DisabledIf(value = "oldElasticsearchClient", disabledReason = "not implemented for the deprecated old client") @Test // #1458 @DisplayName("should put, get and delete index template of components") void shouldPutGetAndDeleteIndexTemplateOfComponents() { @@ -316,7 +302,6 @@ public abstract class IndexTemplateIntegrationTests implements NewElasticsearchC assertThat(templateData).isNull(); } - @DisabledIf(value = "rhlcWithCluster8", disabledReason = "RHLC fails to parse response from ES 8.2") @Test // DATAES-612, #2073 void shouldGetTemplate() throws JSONException { IndexOperations indexOps = operations.indexOps(IndexCoordinates.of("dont-care")); diff --git a/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderELCIntegrationTests.java index 1477f3a12..5304d2c0f 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderELCIntegrationTests.java @@ -37,9 +37,4 @@ public class MappingBuilderELCIntegrationTests extends MappingBuilderIntegration return new IndexNameProvider("mappingbuilder"); } } - - @Override - public boolean newElasticsearchClient() { - return true; - } } diff --git a/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderIntegrationTests.java index cdd9896b7..849cfabe2 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderIntegrationTests.java @@ -39,7 +39,6 @@ import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.annotation.Id; -import org.springframework.data.elasticsearch.NewElasticsearchClientDevelopment; import org.springframework.data.elasticsearch.annotations.*; import org.springframework.data.elasticsearch.core.ElasticsearchOperations; import org.springframework.data.elasticsearch.core.IndexOperations; @@ -64,8 +63,7 @@ import org.springframework.lang.Nullable; * @author Morgan Lutz */ @SpringIntegrationTest -public abstract class MappingBuilderIntegrationTests extends MappingContextBaseTests - implements NewElasticsearchClientDevelopment { +public abstract class MappingBuilderIntegrationTests extends MappingContextBaseTests { @Autowired private ElasticsearchOperations operations; @Autowired protected IndexNameProvider indexNameProvider; diff --git a/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveIndexOperationsELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveIndexOperationsELCIntegrationTests.java index 7a460bba4..7666f9153 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveIndexOperationsELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveIndexOperationsELCIntegrationTests.java @@ -35,9 +35,4 @@ public class ReactiveIndexOperationsELCIntegrationTests extends ReactiveIndexOpe return new IndexNameProvider("reactive-indexoperations"); } } - - @Override - public boolean newElasticsearchClient() { - return true; - } } diff --git a/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveIndexOperationsIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveIndexOperationsIntegrationTests.java index 17385558a..d3265c7a9 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveIndexOperationsIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveIndexOperationsIntegrationTests.java @@ -30,7 +30,6 @@ import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.annotation.Id; -import org.springframework.data.elasticsearch.NewElasticsearchClientDevelopment; import org.springframework.data.elasticsearch.annotations.DateFormat; import org.springframework.data.elasticsearch.annotations.Document; import org.springframework.data.elasticsearch.annotations.Field; @@ -49,17 +48,12 @@ import org.springframework.lang.Nullable; * @author Peter-Josef Meisch */ @SpringIntegrationTest -public abstract class ReactiveIndexOperationsIntegrationTests implements NewElasticsearchClientDevelopment { +public abstract class ReactiveIndexOperationsIntegrationTests { @Autowired private ReactiveElasticsearchOperations operations; @Autowired private IndexNameProvider indexNameProvider; private ReactiveIndexOperations indexOperations; - boolean rhlcWithCluster8() { - var clusterVersion = ((AbstractReactiveElasticsearchTemplate) operations).getClusterVersion().block(); - return (oldElasticsearchClient() && clusterVersion != null && clusterVersion.startsWith("8")); - } - @BeforeEach void setUp() { indexNameProvider.increment(); diff --git a/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveIndexTemplateELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveIndexTemplateELCIntegrationTests.java index 8062c9dd2..a608aad63 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveIndexTemplateELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveIndexTemplateELCIntegrationTests.java @@ -35,9 +35,4 @@ public class ReactiveIndexTemplateELCIntegrationTests extends ReactiveIndexTempl return new IndexNameProvider("reactive-index-template"); } } - - @Override - public boolean newElasticsearchClient() { - return true; - } } diff --git a/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveIndexTemplateIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveIndexTemplateIntegrationTests.java index fdd2501bf..4303fc8ed 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveIndexTemplateIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveIndexTemplateIntegrationTests.java @@ -30,10 +30,8 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.condition.DisabledIf; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.annotation.Id; -import org.springframework.data.elasticsearch.NewElasticsearchClientDevelopment; import org.springframework.data.elasticsearch.annotations.Document; import org.springframework.data.elasticsearch.annotations.Field; import org.springframework.data.elasticsearch.annotations.FieldType; @@ -53,17 +51,12 @@ import org.springframework.lang.Nullable; * @author Peter-Josef Meisch */ @SpringIntegrationTest -public abstract class ReactiveIndexTemplateIntegrationTests implements NewElasticsearchClientDevelopment { +public abstract class ReactiveIndexTemplateIntegrationTests { @Autowired private ReactiveElasticsearchOperations operations; @Autowired private IndexNameProvider indexNameProvider; private ReactiveIndexOperations indexOperations; - boolean rhlcWithCluster8() { - var clusterVersion = ((AbstractReactiveElasticsearchTemplate) operations).getClusterVersion().block(); - return (oldElasticsearchClient() && clusterVersion != null && clusterVersion.startsWith("8")); - } - @BeforeEach void setUp() { indexNameProvider.increment(); @@ -76,7 +69,6 @@ public abstract class ReactiveIndexTemplateIntegrationTests implements NewElasti operations.indexOps(IndexCoordinates.of(indexNameProvider.getPrefix() + "*")).delete().block(); } - @DisabledIf(value = "rhlcWithCluster8", disabledReason = "RHLC fails to parse response from ES 8.2") @Test // DATAES-612 void shouldPutTemplate() { @@ -98,7 +90,6 @@ public abstract class ReactiveIndexTemplateIntegrationTests implements NewElasti assertThat(acknowledged).isTrue(); } - @DisabledIf(value = "oldElasticsearchClient", disabledReason = "not implemented for the deprecated old client") @Test // #1458 @DisplayName("should create component template") void shouldCreateComponentTemplate() { @@ -129,7 +120,6 @@ public abstract class ReactiveIndexTemplateIntegrationTests implements NewElasti assertThat(acknowledged).isTrue(); } - @DisabledIf(value = "oldElasticsearchClient", disabledReason = "not implemented for the deprecated old client") @Test // #1458 @DisplayName("should get component template") void shouldGetComponentTemplate() throws JSONException { @@ -179,7 +169,6 @@ public abstract class ReactiveIndexTemplateIntegrationTests implements NewElasti assertThat(alias2.getAlias()).isEqualTo("alias2"); } - @DisabledIf(value = "oldElasticsearchClient", disabledReason = "not implemented for the deprecated old client") @Test // #1458 @DisplayName("should delete component template") void shouldDeleteComponentTemplate() { @@ -207,7 +196,6 @@ public abstract class ReactiveIndexTemplateIntegrationTests implements NewElasti assertThat(exists).isFalse(); } - @DisabledIf(value = "oldElasticsearchClient", disabledReason = "not implemented for the deprecated old client") @Test // #1458 @DisplayName("should put, get and delete index template with template") void shouldPutGetAndDeleteIndexTemplateWithTemplate() { @@ -248,7 +236,6 @@ public abstract class ReactiveIndexTemplateIntegrationTests implements NewElasti assertThat(exists).isFalse(); } - @DisabledIf(value = "oldElasticsearchClient", disabledReason = "not implemented for the deprecated old client") @Test // #1458 @DisplayName("should put, get and delete index template of components") void shouldPutGetAndDeleteIndexTemplateOfComponents() { @@ -339,7 +326,6 @@ public abstract class ReactiveIndexTemplateIntegrationTests implements NewElasti .verifyComplete(); } - @DisabledIf(value = "rhlcWithCluster8", disabledReason = "RHLC fails to parse response from ES 8.2") @Test // DATAES-612 void shouldGetTemplate() throws JSONException { diff --git a/src/test/java/org/springframework/data/elasticsearch/core/suggest/CompletionELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/suggest/CompletionELCIntegrationTests.java index ae15608ee..7d1e968a4 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/suggest/CompletionELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/suggest/CompletionELCIntegrationTests.java @@ -46,11 +46,6 @@ public class CompletionELCIntegrationTests extends CompletionIntegrationTests { } } - @Override - public boolean newElasticsearchClient() { - return true; - } - @Override protected Query getSuggestQuery(String suggestionName, String fieldName, String prefix) { return NativeQuery.builder() // diff --git a/src/test/java/org/springframework/data/elasticsearch/core/suggest/CompletionIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/suggest/CompletionIntegrationTests.java index 4bf70ad05..da4a81cd4 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/suggest/CompletionIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/suggest/CompletionIntegrationTests.java @@ -25,7 +25,6 @@ import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.annotation.Id; -import org.springframework.data.elasticsearch.NewElasticsearchClientDevelopment; import org.springframework.data.elasticsearch.annotations.CompletionField; import org.springframework.data.elasticsearch.annotations.Document; import org.springframework.data.elasticsearch.core.ElasticsearchOperations; @@ -48,7 +47,7 @@ import org.springframework.lang.Nullable; * @author Peter-Josef Meisch */ @SpringIntegrationTest -public abstract class CompletionIntegrationTests implements NewElasticsearchClientDevelopment { +public abstract class CompletionIntegrationTests { @Autowired private ElasticsearchOperations operations; @Autowired private IndexNameProvider indexNameProvider; diff --git a/src/test/java/org/springframework/data/elasticsearch/core/suggest/ReactiveSuggestELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/suggest/ReactiveSuggestELCIntegrationTests.java index 1d4414fd7..ac39ab785 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/suggest/ReactiveSuggestELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/suggest/ReactiveSuggestELCIntegrationTests.java @@ -44,11 +44,6 @@ public class ReactiveSuggestELCIntegrationTests extends ReactiveSuggestIntegrati } } - @Override - public boolean newElasticsearchClient() { - return true; - } - @Override protected Query getSuggestQuery(String suggestionName, String fieldName, String prefix) { return NativeQuery.builder() // diff --git a/src/test/java/org/springframework/data/elasticsearch/core/suggest/ReactiveSuggestIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/suggest/ReactiveSuggestIntegrationTests.java index c6ef42296..2f2f24795 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/suggest/ReactiveSuggestIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/suggest/ReactiveSuggestIntegrationTests.java @@ -30,7 +30,6 @@ import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.annotation.Id; -import org.springframework.data.elasticsearch.NewElasticsearchClientDevelopment; import org.springframework.data.elasticsearch.annotations.CompletionField; import org.springframework.data.elasticsearch.annotations.Document; import org.springframework.data.elasticsearch.core.ReactiveElasticsearchOperations; @@ -47,7 +46,7 @@ import org.springframework.lang.Nullable; * @author Peter-Josef Meisch */ @SpringIntegrationTest -public abstract class ReactiveSuggestIntegrationTests implements NewElasticsearchClientDevelopment { +public abstract class ReactiveSuggestIntegrationTests { @Autowired private ReactiveElasticsearchOperations operations; @Autowired private IndexNameProvider indexNameProvider; diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/custommethod/CustomMethodRepositoryELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repositories/custommethod/CustomMethodRepositoryELCIntegrationTests.java index c52a2fb9c..dfd2441bc 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/custommethod/CustomMethodRepositoryELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/custommethod/CustomMethodRepositoryELCIntegrationTests.java @@ -41,9 +41,4 @@ public class CustomMethodRepositoryELCIntegrationTests extends CustomMethodRepos return new IndexNameProvider("custom-method-repository"); } } - - @Override - public boolean newElasticsearchClient() { - return true; - } } diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/custommethod/CustomMethodRepositoryIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repositories/custommethod/CustomMethodRepositoryIntegrationTests.java index d481ee9c7..522c14e0f 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/custommethod/CustomMethodRepositoryIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/custommethod/CustomMethodRepositoryIntegrationTests.java @@ -41,7 +41,6 @@ import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Sort; import org.springframework.data.domain.Sort.Order; -import org.springframework.data.elasticsearch.NewElasticsearchClientDevelopment; import org.springframework.data.elasticsearch.annotations.CountQuery; import org.springframework.data.elasticsearch.annotations.Document; import org.springframework.data.elasticsearch.annotations.Field; @@ -79,18 +78,13 @@ import org.springframework.lang.Nullable; * @author James Mudd */ @SpringIntegrationTest -public abstract class CustomMethodRepositoryIntegrationTests implements NewElasticsearchClientDevelopment { +public abstract class CustomMethodRepositoryIntegrationTests { @Autowired ElasticsearchOperations operations; @Autowired private IndexNameProvider indexNameProvider; @Autowired private SampleCustomMethodRepository repository; @Autowired private SampleStreamingCustomMethodRepository streamingRepository; - boolean rhlcWithCluster8() { - var clusterVersion = ((AbstractElasticsearchTemplate) operations).getClusterVersion(); - return (oldElasticsearchClient() && clusterVersion != null && clusterVersion.startsWith("8")); - } - @BeforeEach public void before() { @@ -814,7 +808,6 @@ public abstract class CustomMethodRepositoryIntegrationTests implements NewElast assertThat(page.getTotalElements()).isEqualTo(1L); } - @DisabledIf(value = "rhlcWithCluster8", disabledReason = "RHLC fails to parse response from ES 8.2") @Test public void shouldExecuteCustomMethodWithNearBox() { @@ -1374,7 +1367,6 @@ public abstract class CustomMethodRepositoryIntegrationTests implements NewElast assertThat(count).isEqualTo(1L); } - @DisabledIf(value = "rhlcWithCluster8", disabledReason = "RHLC fails to parse response from ES 8.2") @Test // DATAES-106 public void shouldCountCustomMethodWithNearBox() {