mirror of
https://github.com/spring-projects/spring-data-elasticsearch.git
synced 2025-06-14 16:12:11 +00:00
parent
36e3b93ea9
commit
f973236588
@ -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();
|
|
||||||
}
|
|
||||||
}
|
|
@ -45,11 +45,6 @@ public class GeoELCIntegrationTests extends GeoIntegrationTests {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean newElasticsearchClient() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Query nativeQueryForBoundingBox(String fieldName, double top, double left, double bottom, double right) {
|
protected Query nativeQueryForBoundingBox(String fieldName, double top, double left, double bottom, double right) {
|
||||||
return NativeQuery.builder() //
|
return NativeQuery.builder() //
|
||||||
|
@ -26,7 +26,6 @@ import org.junit.jupiter.api.Test;
|
|||||||
import org.junit.jupiter.api.condition.DisabledIf;
|
import org.junit.jupiter.api.condition.DisabledIf;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.data.annotation.Id;
|
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.Document;
|
||||||
import org.springframework.data.elasticsearch.annotations.GeoPointField;
|
import org.springframework.data.elasticsearch.annotations.GeoPointField;
|
||||||
import org.springframework.data.elasticsearch.core.AbstractElasticsearchTemplate;
|
import org.springframework.data.elasticsearch.core.AbstractElasticsearchTemplate;
|
||||||
@ -56,16 +55,11 @@ import org.springframework.lang.Nullable;
|
|||||||
* Latitude , max Longitude , max Latitude
|
* Latitude , max Longitude , max Latitude
|
||||||
*/
|
*/
|
||||||
@SpringIntegrationTest
|
@SpringIntegrationTest
|
||||||
public abstract class GeoIntegrationTests implements NewElasticsearchClientDevelopment {
|
public abstract class GeoIntegrationTests {
|
||||||
|
|
||||||
@Autowired private ElasticsearchOperations operations;
|
@Autowired private ElasticsearchOperations operations;
|
||||||
@Autowired private IndexNameProvider indexNameProvider;
|
@Autowired private IndexNameProvider indexNameProvider;
|
||||||
|
|
||||||
boolean rhlcWithCluster8() {
|
|
||||||
var clusterVersion = ((AbstractElasticsearchTemplate) operations).getClusterVersion();
|
|
||||||
return (oldElasticsearchClient() && clusterVersion != null && clusterVersion.startsWith("8"));
|
|
||||||
}
|
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
public void before() {
|
public void before() {
|
||||||
indexNameProvider.increment();
|
indexNameProvider.increment();
|
||||||
@ -227,7 +221,6 @@ public abstract class GeoIntegrationTests implements NewElasticsearchClientDevel
|
|||||||
assertThat(geoAuthorsForGeoCriteria).hasSize(3);
|
assertThat(geoAuthorsForGeoCriteria).hasSize(3);
|
||||||
}
|
}
|
||||||
|
|
||||||
@DisabledIf(value = "rhlcWithCluster8", disabledReason = "RHLC fails to parse response from ES 8.2")
|
|
||||||
@Test
|
@Test
|
||||||
public void shouldFindAllMarkersForNativeSearchQuery() {
|
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,
|
protected abstract Query nativeQueryForBoundingBox(String fieldName, double top, double left, double bottom,
|
||||||
double right);
|
double right);
|
||||||
|
|
||||||
@DisabledIf(value = "rhlcWithCluster8", disabledReason = "RHLC fails to parse response from ES 8.2")
|
|
||||||
@Test
|
@Test
|
||||||
public void shouldFindAuthorMarkersInBoxForGivenCriteriaQueryUsingGeoBox() {
|
public void shouldFindAuthorMarkersInBoxForGivenCriteriaQueryUsingGeoBox() {
|
||||||
|
|
||||||
@ -264,7 +256,6 @@ public abstract class GeoIntegrationTests implements NewElasticsearchClientDevel
|
|||||||
.containsExactlyInAnyOrder("def", "ghi");
|
.containsExactlyInAnyOrder("def", "ghi");
|
||||||
}
|
}
|
||||||
|
|
||||||
@DisabledIf(value = "rhlcWithCluster8", disabledReason = "RHLC fails to parse response from ES 8.2")
|
|
||||||
@Test
|
@Test
|
||||||
public void shouldFindAuthorMarkersInBoxForGivenCriteriaQueryUsingGeohash() {
|
public void shouldFindAuthorMarkersInBoxForGivenCriteriaQueryUsingGeohash() {
|
||||||
|
|
||||||
@ -283,7 +274,6 @@ public abstract class GeoIntegrationTests implements NewElasticsearchClientDevel
|
|||||||
.containsExactlyInAnyOrder("def", "ghi");
|
.containsExactlyInAnyOrder("def", "ghi");
|
||||||
}
|
}
|
||||||
|
|
||||||
@DisabledIf(value = "rhlcWithCluster8", disabledReason = "RHLC fails to parse response from ES 8.2")
|
|
||||||
@Test
|
@Test
|
||||||
public void shouldFindAuthorMarkersInBoxForGivenCriteriaQueryUsingGeoPoints() {
|
public void shouldFindAuthorMarkersInBoxForGivenCriteriaQueryUsingGeoPoints() {
|
||||||
|
|
||||||
@ -302,7 +292,6 @@ public abstract class GeoIntegrationTests implements NewElasticsearchClientDevel
|
|||||||
.containsExactlyInAnyOrder("def", "ghi");
|
.containsExactlyInAnyOrder("def", "ghi");
|
||||||
}
|
}
|
||||||
|
|
||||||
@DisabledIf(value = "rhlcWithCluster8", disabledReason = "RHLC fails to parse response from ES 8.2")
|
|
||||||
@Test
|
@Test
|
||||||
public void shouldFindAuthorMarkersInBoxForGivenCriteriaQueryUsingPoints() {
|
public void shouldFindAuthorMarkersInBoxForGivenCriteriaQueryUsingPoints() {
|
||||||
|
|
||||||
@ -321,7 +310,6 @@ public abstract class GeoIntegrationTests implements NewElasticsearchClientDevel
|
|||||||
.containsExactlyInAnyOrder("def", "ghi");
|
.containsExactlyInAnyOrder("def", "ghi");
|
||||||
}
|
}
|
||||||
|
|
||||||
@DisabledIf(value = "rhlcWithCluster8", disabledReason = "RHLC fails to parse response from ES 8.2")
|
|
||||||
@Test
|
@Test
|
||||||
public void shouldFindLocationWithGeoHashPrefix() {
|
public void shouldFindLocationWithGeoHashPrefix() {
|
||||||
|
|
||||||
|
@ -23,9 +23,4 @@ import org.springframework.test.context.ContextConfiguration;
|
|||||||
* @since 4.4
|
* @since 4.4
|
||||||
*/
|
*/
|
||||||
@ContextConfiguration(classes = { ElasticsearchTemplateConfiguration.class })
|
@ContextConfiguration(classes = { ElasticsearchTemplateConfiguration.class })
|
||||||
public class IndexTemplateELCIntegrationTests extends IndexTemplateIntegrationTests {
|
public class IndexTemplateELCIntegrationTests extends IndexTemplateIntegrationTests { }
|
||||||
@Override
|
|
||||||
public boolean newElasticsearchClient() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -25,15 +25,12 @@ import java.util.UUID;
|
|||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.junit.jupiter.api.DisplayName;
|
import org.junit.jupiter.api.DisplayName;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.condition.DisabledIf;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.data.annotation.Id;
|
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.Document;
|
||||||
import org.springframework.data.elasticsearch.annotations.Field;
|
import org.springframework.data.elasticsearch.annotations.Field;
|
||||||
import org.springframework.data.elasticsearch.annotations.FieldType;
|
import org.springframework.data.elasticsearch.annotations.FieldType;
|
||||||
import org.springframework.data.elasticsearch.annotations.Setting;
|
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.ElasticsearchOperations;
|
||||||
import org.springframework.data.elasticsearch.core.IndexOperations;
|
import org.springframework.data.elasticsearch.core.IndexOperations;
|
||||||
import org.springframework.data.elasticsearch.core.mapping.IndexCoordinates;
|
import org.springframework.data.elasticsearch.core.mapping.IndexCoordinates;
|
||||||
@ -47,16 +44,10 @@ import org.springframework.lang.Nullable;
|
|||||||
* @author Peter-Josef Meisch
|
* @author Peter-Josef Meisch
|
||||||
*/
|
*/
|
||||||
@SpringIntegrationTest
|
@SpringIntegrationTest
|
||||||
public abstract class IndexTemplateIntegrationTests implements NewElasticsearchClientDevelopment {
|
public abstract class IndexTemplateIntegrationTests {
|
||||||
|
|
||||||
@Autowired ElasticsearchOperations operations;
|
@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
|
@Test // DATAES-612
|
||||||
void shouldPutTemplate() {
|
void shouldPutTemplate() {
|
||||||
|
|
||||||
@ -78,7 +69,6 @@ public abstract class IndexTemplateIntegrationTests implements NewElasticsearchC
|
|||||||
assertThat(acknowledged).isTrue();
|
assertThat(acknowledged).isTrue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@DisabledIf(value = "oldElasticsearchClient", disabledReason = "not implemented for the deprecated old client")
|
|
||||||
@Test // #1458
|
@Test // #1458
|
||||||
@DisplayName("should create component template")
|
@DisplayName("should create component template")
|
||||||
void shouldCreateComponentTemplate() {
|
void shouldCreateComponentTemplate() {
|
||||||
@ -108,7 +98,6 @@ public abstract class IndexTemplateIntegrationTests implements NewElasticsearchC
|
|||||||
assertThat(acknowledged).isTrue();
|
assertThat(acknowledged).isTrue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@DisabledIf(value = "oldElasticsearchClient", disabledReason = "not implemented for the deprecated old client")
|
|
||||||
@Test // #1458
|
@Test // #1458
|
||||||
@DisplayName("should get component template")
|
@DisplayName("should get component template")
|
||||||
void shouldGetComponentTemplate() throws JSONException {
|
void shouldGetComponentTemplate() throws JSONException {
|
||||||
@ -157,7 +146,6 @@ public abstract class IndexTemplateIntegrationTests implements NewElasticsearchC
|
|||||||
assertThat(alias2.getAlias()).isEqualTo("alias2");
|
assertThat(alias2.getAlias()).isEqualTo("alias2");
|
||||||
}
|
}
|
||||||
|
|
||||||
@DisabledIf(value = "oldElasticsearchClient", disabledReason = "not implemented for the deprecated old client")
|
|
||||||
@Test // #1458
|
@Test // #1458
|
||||||
@DisplayName("should delete component template")
|
@DisplayName("should delete component template")
|
||||||
void shouldDeleteComponentTemplate() {
|
void shouldDeleteComponentTemplate() {
|
||||||
@ -185,7 +173,6 @@ public abstract class IndexTemplateIntegrationTests implements NewElasticsearchC
|
|||||||
assertThat(exists).isFalse();
|
assertThat(exists).isFalse();
|
||||||
}
|
}
|
||||||
|
|
||||||
@DisabledIf(value = "oldElasticsearchClient", disabledReason = "not implemented for the deprecated old client")
|
|
||||||
@Test // #1458
|
@Test // #1458
|
||||||
@DisplayName("should put, get and delete index template with template")
|
@DisplayName("should put, get and delete index template with template")
|
||||||
void shouldPutGetAndDeleteIndexTemplateWithTemplate() {
|
void shouldPutGetAndDeleteIndexTemplateWithTemplate() {
|
||||||
@ -225,7 +212,6 @@ public abstract class IndexTemplateIntegrationTests implements NewElasticsearchC
|
|||||||
assertThat(exists).isFalse();
|
assertThat(exists).isFalse();
|
||||||
}
|
}
|
||||||
|
|
||||||
@DisabledIf(value = "oldElasticsearchClient", disabledReason = "not implemented for the deprecated old client")
|
|
||||||
@Test // #1458
|
@Test // #1458
|
||||||
@DisplayName("should put, get and delete index template of components")
|
@DisplayName("should put, get and delete index template of components")
|
||||||
void shouldPutGetAndDeleteIndexTemplateOfComponents() {
|
void shouldPutGetAndDeleteIndexTemplateOfComponents() {
|
||||||
@ -316,7 +302,6 @@ public abstract class IndexTemplateIntegrationTests implements NewElasticsearchC
|
|||||||
assertThat(templateData).isNull();
|
assertThat(templateData).isNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
@DisabledIf(value = "rhlcWithCluster8", disabledReason = "RHLC fails to parse response from ES 8.2")
|
|
||||||
@Test // DATAES-612, #2073
|
@Test // DATAES-612, #2073
|
||||||
void shouldGetTemplate() throws JSONException {
|
void shouldGetTemplate() throws JSONException {
|
||||||
IndexOperations indexOps = operations.indexOps(IndexCoordinates.of("dont-care"));
|
IndexOperations indexOps = operations.indexOps(IndexCoordinates.of("dont-care"));
|
||||||
|
@ -37,9 +37,4 @@ public class MappingBuilderELCIntegrationTests extends MappingBuilderIntegration
|
|||||||
return new IndexNameProvider("mappingbuilder");
|
return new IndexNameProvider("mappingbuilder");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean newElasticsearchClient() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,6 @@ import org.junit.jupiter.api.Order;
|
|||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.data.annotation.Id;
|
import org.springframework.data.annotation.Id;
|
||||||
import org.springframework.data.elasticsearch.NewElasticsearchClientDevelopment;
|
|
||||||
import org.springframework.data.elasticsearch.annotations.*;
|
import org.springframework.data.elasticsearch.annotations.*;
|
||||||
import org.springframework.data.elasticsearch.core.ElasticsearchOperations;
|
import org.springframework.data.elasticsearch.core.ElasticsearchOperations;
|
||||||
import org.springframework.data.elasticsearch.core.IndexOperations;
|
import org.springframework.data.elasticsearch.core.IndexOperations;
|
||||||
@ -64,8 +63,7 @@ import org.springframework.lang.Nullable;
|
|||||||
* @author Morgan Lutz
|
* @author Morgan Lutz
|
||||||
*/
|
*/
|
||||||
@SpringIntegrationTest
|
@SpringIntegrationTest
|
||||||
public abstract class MappingBuilderIntegrationTests extends MappingContextBaseTests
|
public abstract class MappingBuilderIntegrationTests extends MappingContextBaseTests {
|
||||||
implements NewElasticsearchClientDevelopment {
|
|
||||||
|
|
||||||
@Autowired private ElasticsearchOperations operations;
|
@Autowired private ElasticsearchOperations operations;
|
||||||
@Autowired protected IndexNameProvider indexNameProvider;
|
@Autowired protected IndexNameProvider indexNameProvider;
|
||||||
|
@ -35,9 +35,4 @@ public class ReactiveIndexOperationsELCIntegrationTests extends ReactiveIndexOpe
|
|||||||
return new IndexNameProvider("reactive-indexoperations");
|
return new IndexNameProvider("reactive-indexoperations");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean newElasticsearchClient() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,6 @@ import org.junit.jupiter.api.Order;
|
|||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.data.annotation.Id;
|
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.DateFormat;
|
||||||
import org.springframework.data.elasticsearch.annotations.Document;
|
import org.springframework.data.elasticsearch.annotations.Document;
|
||||||
import org.springframework.data.elasticsearch.annotations.Field;
|
import org.springframework.data.elasticsearch.annotations.Field;
|
||||||
@ -49,17 +48,12 @@ import org.springframework.lang.Nullable;
|
|||||||
* @author Peter-Josef Meisch
|
* @author Peter-Josef Meisch
|
||||||
*/
|
*/
|
||||||
@SpringIntegrationTest
|
@SpringIntegrationTest
|
||||||
public abstract class ReactiveIndexOperationsIntegrationTests implements NewElasticsearchClientDevelopment {
|
public abstract class ReactiveIndexOperationsIntegrationTests {
|
||||||
|
|
||||||
@Autowired private ReactiveElasticsearchOperations operations;
|
@Autowired private ReactiveElasticsearchOperations operations;
|
||||||
@Autowired private IndexNameProvider indexNameProvider;
|
@Autowired private IndexNameProvider indexNameProvider;
|
||||||
private ReactiveIndexOperations indexOperations;
|
private ReactiveIndexOperations indexOperations;
|
||||||
|
|
||||||
boolean rhlcWithCluster8() {
|
|
||||||
var clusterVersion = ((AbstractReactiveElasticsearchTemplate) operations).getClusterVersion().block();
|
|
||||||
return (oldElasticsearchClient() && clusterVersion != null && clusterVersion.startsWith("8"));
|
|
||||||
}
|
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
void setUp() {
|
void setUp() {
|
||||||
indexNameProvider.increment();
|
indexNameProvider.increment();
|
||||||
|
@ -35,9 +35,4 @@ public class ReactiveIndexTemplateELCIntegrationTests extends ReactiveIndexTempl
|
|||||||
return new IndexNameProvider("reactive-index-template");
|
return new IndexNameProvider("reactive-index-template");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean newElasticsearchClient() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -30,10 +30,8 @@ import org.junit.jupiter.api.BeforeEach;
|
|||||||
import org.junit.jupiter.api.DisplayName;
|
import org.junit.jupiter.api.DisplayName;
|
||||||
import org.junit.jupiter.api.Order;
|
import org.junit.jupiter.api.Order;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.condition.DisabledIf;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.data.annotation.Id;
|
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.Document;
|
||||||
import org.springframework.data.elasticsearch.annotations.Field;
|
import org.springframework.data.elasticsearch.annotations.Field;
|
||||||
import org.springframework.data.elasticsearch.annotations.FieldType;
|
import org.springframework.data.elasticsearch.annotations.FieldType;
|
||||||
@ -53,17 +51,12 @@ import org.springframework.lang.Nullable;
|
|||||||
* @author Peter-Josef Meisch
|
* @author Peter-Josef Meisch
|
||||||
*/
|
*/
|
||||||
@SpringIntegrationTest
|
@SpringIntegrationTest
|
||||||
public abstract class ReactiveIndexTemplateIntegrationTests implements NewElasticsearchClientDevelopment {
|
public abstract class ReactiveIndexTemplateIntegrationTests {
|
||||||
|
|
||||||
@Autowired private ReactiveElasticsearchOperations operations;
|
@Autowired private ReactiveElasticsearchOperations operations;
|
||||||
@Autowired private IndexNameProvider indexNameProvider;
|
@Autowired private IndexNameProvider indexNameProvider;
|
||||||
private ReactiveIndexOperations indexOperations;
|
private ReactiveIndexOperations indexOperations;
|
||||||
|
|
||||||
boolean rhlcWithCluster8() {
|
|
||||||
var clusterVersion = ((AbstractReactiveElasticsearchTemplate) operations).getClusterVersion().block();
|
|
||||||
return (oldElasticsearchClient() && clusterVersion != null && clusterVersion.startsWith("8"));
|
|
||||||
}
|
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
void setUp() {
|
void setUp() {
|
||||||
indexNameProvider.increment();
|
indexNameProvider.increment();
|
||||||
@ -76,7 +69,6 @@ public abstract class ReactiveIndexTemplateIntegrationTests implements NewElasti
|
|||||||
operations.indexOps(IndexCoordinates.of(indexNameProvider.getPrefix() + "*")).delete().block();
|
operations.indexOps(IndexCoordinates.of(indexNameProvider.getPrefix() + "*")).delete().block();
|
||||||
}
|
}
|
||||||
|
|
||||||
@DisabledIf(value = "rhlcWithCluster8", disabledReason = "RHLC fails to parse response from ES 8.2")
|
|
||||||
@Test // DATAES-612
|
@Test // DATAES-612
|
||||||
void shouldPutTemplate() {
|
void shouldPutTemplate() {
|
||||||
|
|
||||||
@ -98,7 +90,6 @@ public abstract class ReactiveIndexTemplateIntegrationTests implements NewElasti
|
|||||||
assertThat(acknowledged).isTrue();
|
assertThat(acknowledged).isTrue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@DisabledIf(value = "oldElasticsearchClient", disabledReason = "not implemented for the deprecated old client")
|
|
||||||
@Test // #1458
|
@Test // #1458
|
||||||
@DisplayName("should create component template")
|
@DisplayName("should create component template")
|
||||||
void shouldCreateComponentTemplate() {
|
void shouldCreateComponentTemplate() {
|
||||||
@ -129,7 +120,6 @@ public abstract class ReactiveIndexTemplateIntegrationTests implements NewElasti
|
|||||||
assertThat(acknowledged).isTrue();
|
assertThat(acknowledged).isTrue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@DisabledIf(value = "oldElasticsearchClient", disabledReason = "not implemented for the deprecated old client")
|
|
||||||
@Test // #1458
|
@Test // #1458
|
||||||
@DisplayName("should get component template")
|
@DisplayName("should get component template")
|
||||||
void shouldGetComponentTemplate() throws JSONException {
|
void shouldGetComponentTemplate() throws JSONException {
|
||||||
@ -179,7 +169,6 @@ public abstract class ReactiveIndexTemplateIntegrationTests implements NewElasti
|
|||||||
assertThat(alias2.getAlias()).isEqualTo("alias2");
|
assertThat(alias2.getAlias()).isEqualTo("alias2");
|
||||||
}
|
}
|
||||||
|
|
||||||
@DisabledIf(value = "oldElasticsearchClient", disabledReason = "not implemented for the deprecated old client")
|
|
||||||
@Test // #1458
|
@Test // #1458
|
||||||
@DisplayName("should delete component template")
|
@DisplayName("should delete component template")
|
||||||
void shouldDeleteComponentTemplate() {
|
void shouldDeleteComponentTemplate() {
|
||||||
@ -207,7 +196,6 @@ public abstract class ReactiveIndexTemplateIntegrationTests implements NewElasti
|
|||||||
assertThat(exists).isFalse();
|
assertThat(exists).isFalse();
|
||||||
}
|
}
|
||||||
|
|
||||||
@DisabledIf(value = "oldElasticsearchClient", disabledReason = "not implemented for the deprecated old client")
|
|
||||||
@Test // #1458
|
@Test // #1458
|
||||||
@DisplayName("should put, get and delete index template with template")
|
@DisplayName("should put, get and delete index template with template")
|
||||||
void shouldPutGetAndDeleteIndexTemplateWithTemplate() {
|
void shouldPutGetAndDeleteIndexTemplateWithTemplate() {
|
||||||
@ -248,7 +236,6 @@ public abstract class ReactiveIndexTemplateIntegrationTests implements NewElasti
|
|||||||
assertThat(exists).isFalse();
|
assertThat(exists).isFalse();
|
||||||
}
|
}
|
||||||
|
|
||||||
@DisabledIf(value = "oldElasticsearchClient", disabledReason = "not implemented for the deprecated old client")
|
|
||||||
@Test // #1458
|
@Test // #1458
|
||||||
@DisplayName("should put, get and delete index template of components")
|
@DisplayName("should put, get and delete index template of components")
|
||||||
void shouldPutGetAndDeleteIndexTemplateOfComponents() {
|
void shouldPutGetAndDeleteIndexTemplateOfComponents() {
|
||||||
@ -339,7 +326,6 @@ public abstract class ReactiveIndexTemplateIntegrationTests implements NewElasti
|
|||||||
.verifyComplete();
|
.verifyComplete();
|
||||||
}
|
}
|
||||||
|
|
||||||
@DisabledIf(value = "rhlcWithCluster8", disabledReason = "RHLC fails to parse response from ES 8.2")
|
|
||||||
@Test // DATAES-612
|
@Test // DATAES-612
|
||||||
void shouldGetTemplate() throws JSONException {
|
void shouldGetTemplate() throws JSONException {
|
||||||
|
|
||||||
|
@ -46,11 +46,6 @@ public class CompletionELCIntegrationTests extends CompletionIntegrationTests {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean newElasticsearchClient() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Query getSuggestQuery(String suggestionName, String fieldName, String prefix) {
|
protected Query getSuggestQuery(String suggestionName, String fieldName, String prefix) {
|
||||||
return NativeQuery.builder() //
|
return NativeQuery.builder() //
|
||||||
|
@ -25,7 +25,6 @@ import org.junit.jupiter.api.Order;
|
|||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.data.annotation.Id;
|
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.CompletionField;
|
||||||
import org.springframework.data.elasticsearch.annotations.Document;
|
import org.springframework.data.elasticsearch.annotations.Document;
|
||||||
import org.springframework.data.elasticsearch.core.ElasticsearchOperations;
|
import org.springframework.data.elasticsearch.core.ElasticsearchOperations;
|
||||||
@ -48,7 +47,7 @@ import org.springframework.lang.Nullable;
|
|||||||
* @author Peter-Josef Meisch
|
* @author Peter-Josef Meisch
|
||||||
*/
|
*/
|
||||||
@SpringIntegrationTest
|
@SpringIntegrationTest
|
||||||
public abstract class CompletionIntegrationTests implements NewElasticsearchClientDevelopment {
|
public abstract class CompletionIntegrationTests {
|
||||||
|
|
||||||
@Autowired private ElasticsearchOperations operations;
|
@Autowired private ElasticsearchOperations operations;
|
||||||
@Autowired private IndexNameProvider indexNameProvider;
|
@Autowired private IndexNameProvider indexNameProvider;
|
||||||
|
@ -44,11 +44,6 @@ public class ReactiveSuggestELCIntegrationTests extends ReactiveSuggestIntegrati
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean newElasticsearchClient() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Query getSuggestQuery(String suggestionName, String fieldName, String prefix) {
|
protected Query getSuggestQuery(String suggestionName, String fieldName, String prefix) {
|
||||||
return NativeQuery.builder() //
|
return NativeQuery.builder() //
|
||||||
|
@ -30,7 +30,6 @@ import org.junit.jupiter.api.Order;
|
|||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.data.annotation.Id;
|
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.CompletionField;
|
||||||
import org.springframework.data.elasticsearch.annotations.Document;
|
import org.springframework.data.elasticsearch.annotations.Document;
|
||||||
import org.springframework.data.elasticsearch.core.ReactiveElasticsearchOperations;
|
import org.springframework.data.elasticsearch.core.ReactiveElasticsearchOperations;
|
||||||
@ -47,7 +46,7 @@ import org.springframework.lang.Nullable;
|
|||||||
* @author Peter-Josef Meisch
|
* @author Peter-Josef Meisch
|
||||||
*/
|
*/
|
||||||
@SpringIntegrationTest
|
@SpringIntegrationTest
|
||||||
public abstract class ReactiveSuggestIntegrationTests implements NewElasticsearchClientDevelopment {
|
public abstract class ReactiveSuggestIntegrationTests {
|
||||||
|
|
||||||
@Autowired private ReactiveElasticsearchOperations operations;
|
@Autowired private ReactiveElasticsearchOperations operations;
|
||||||
@Autowired private IndexNameProvider indexNameProvider;
|
@Autowired private IndexNameProvider indexNameProvider;
|
||||||
|
@ -41,9 +41,4 @@ public class CustomMethodRepositoryELCIntegrationTests extends CustomMethodRepos
|
|||||||
return new IndexNameProvider("custom-method-repository");
|
return new IndexNameProvider("custom-method-repository");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean newElasticsearchClient() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,6 @@ import org.springframework.data.domain.PageRequest;
|
|||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.data.domain.Sort;
|
import org.springframework.data.domain.Sort;
|
||||||
import org.springframework.data.domain.Sort.Order;
|
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.CountQuery;
|
||||||
import org.springframework.data.elasticsearch.annotations.Document;
|
import org.springframework.data.elasticsearch.annotations.Document;
|
||||||
import org.springframework.data.elasticsearch.annotations.Field;
|
import org.springframework.data.elasticsearch.annotations.Field;
|
||||||
@ -79,18 +78,13 @@ import org.springframework.lang.Nullable;
|
|||||||
* @author James Mudd
|
* @author James Mudd
|
||||||
*/
|
*/
|
||||||
@SpringIntegrationTest
|
@SpringIntegrationTest
|
||||||
public abstract class CustomMethodRepositoryIntegrationTests implements NewElasticsearchClientDevelopment {
|
public abstract class CustomMethodRepositoryIntegrationTests {
|
||||||
|
|
||||||
@Autowired ElasticsearchOperations operations;
|
@Autowired ElasticsearchOperations operations;
|
||||||
@Autowired private IndexNameProvider indexNameProvider;
|
@Autowired private IndexNameProvider indexNameProvider;
|
||||||
@Autowired private SampleCustomMethodRepository repository;
|
@Autowired private SampleCustomMethodRepository repository;
|
||||||
@Autowired private SampleStreamingCustomMethodRepository streamingRepository;
|
@Autowired private SampleStreamingCustomMethodRepository streamingRepository;
|
||||||
|
|
||||||
boolean rhlcWithCluster8() {
|
|
||||||
var clusterVersion = ((AbstractElasticsearchTemplate) operations).getClusterVersion();
|
|
||||||
return (oldElasticsearchClient() && clusterVersion != null && clusterVersion.startsWith("8"));
|
|
||||||
}
|
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
public void before() {
|
public void before() {
|
||||||
|
|
||||||
@ -814,7 +808,6 @@ public abstract class CustomMethodRepositoryIntegrationTests implements NewElast
|
|||||||
assertThat(page.getTotalElements()).isEqualTo(1L);
|
assertThat(page.getTotalElements()).isEqualTo(1L);
|
||||||
}
|
}
|
||||||
|
|
||||||
@DisabledIf(value = "rhlcWithCluster8", disabledReason = "RHLC fails to parse response from ES 8.2")
|
|
||||||
@Test
|
@Test
|
||||||
public void shouldExecuteCustomMethodWithNearBox() {
|
public void shouldExecuteCustomMethodWithNearBox() {
|
||||||
|
|
||||||
@ -1374,7 +1367,6 @@ public abstract class CustomMethodRepositoryIntegrationTests implements NewElast
|
|||||||
assertThat(count).isEqualTo(1L);
|
assertThat(count).isEqualTo(1L);
|
||||||
}
|
}
|
||||||
|
|
||||||
@DisabledIf(value = "rhlcWithCluster8", disabledReason = "RHLC fails to parse response from ES 8.2")
|
|
||||||
@Test // DATAES-106
|
@Test // DATAES-106
|
||||||
public void shouldCountCustomMethodWithNearBox() {
|
public void shouldCountCustomMethodWithNearBox() {
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user