From 71badf428559c961596e5cd67774600e78412586 Mon Sep 17 00:00:00 2001 From: dreis2211 Date: Tue, 13 Apr 2021 19:24:08 +0200 Subject: [PATCH] Fix Spring Data Elasticsearch deprecations --- .../boot/autoconfigure/data/elasticsearch/city/City.java | 6 ++++-- .../main/java/smoketest/data/elasticsearch/Customer.java | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/city/City.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/city/City.java index 7a47db1a6be7..dd2f93324205 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/city/City.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/city/City.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -20,8 +20,10 @@ import org.springframework.data.annotation.Id; import org.springframework.data.elasticsearch.annotations.Document; +import org.springframework.data.elasticsearch.annotations.Setting; -@Document(indexName = "city", shards = 1, replicas = 0, refreshInterval = "-1") +@Document(indexName = "city") +@Setting(shards = 1, replicas = 0, refreshInterval = "-1") public class City implements Serializable { private static final long serialVersionUID = 1L; diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-elasticsearch/src/main/java/smoketest/data/elasticsearch/Customer.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-elasticsearch/src/main/java/smoketest/data/elasticsearch/Customer.java index a25800407910..b5c24f933cfb 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-elasticsearch/src/main/java/smoketest/data/elasticsearch/Customer.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-elasticsearch/src/main/java/smoketest/data/elasticsearch/Customer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 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. @@ -18,8 +18,10 @@ import org.springframework.data.annotation.Id; import org.springframework.data.elasticsearch.annotations.Document; +import org.springframework.data.elasticsearch.annotations.Setting; -@Document(indexName = "customer", shards = 1, replicas = 0, refreshInterval = "-1") +@Document(indexName = "customer") +@Setting(shards = 1, replicas = 0, refreshInterval = "-1") public class Customer { @Id