Skip to content

Commit 7ce329c

Browse files
committed
feat: Add report section "Elasticsearch Clients and Templates"
1 parent c7b2c61 commit 7ce329c

File tree

2 files changed

+115
-0
lines changed

2 files changed

+115
-0
lines changed

components/sbm-recipes-boot-upgrade/src/main/resources/recipes/27_30/report/sbu30-report.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1636,6 +1636,45 @@
16361636
# - Your Name[@your-gh-handle]
16371637

16381638

1639+
#
1640+
# Generated from https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Migration-Guide#elasticsearch-clients-and-templates
1641+
#
1642+
- title: "Elasticsearch Clients and Templates"
1643+
helper:
1644+
type: org.springframework.sbm.boot.upgrade_27_30.report.helper.ConditionOnlyHelper
1645+
condition:
1646+
type: org.springframework.sbm.build.migration.conditions.AnyEffectiveDependencyExistMatchingRegex
1647+
dependencies:
1648+
- 'org\.springframework\.data\:spring-data-elasticsearch\:.*'
1649+
1650+
change: |-
1651+
Support for Elasticsearch's high-level REST client has been removed.
1652+
In its place, auto-configuration for Elasticsearch's new Java client has been introduced.
1653+
Similarly, support for the Spring Data Elasticsearch templates that built on top of the high-level REST client has been removed.
1654+
In its place, auto-configuration for the new templates that build upon the new Java client has been introduced.
1655+
See https://docs.spring.io/spring-data/elasticsearch/docs/current/reference/html/#elasticsearch.clients[the Elasticsearch section of the reference documentation] for further details.
1656+
1657+
`ReactiveElasticsearchRestClientAutoConfiguration` has been renamed to `ReactiveElasticsearchClientAutoConfiguration` and has moved from `org.springframework.boot.autoconfigure.data.elasticsearch` to `org.springframework.boot.autoconfigure.elasticsearch`.
1658+
Any auto-configuration exclusions or ordering should be updated accordingly.
1659+
1660+
affected: |-
1661+
Actually, we don't know if the scanned application is really affected by this change.
1662+
But we found a dependency matching regex `org\.springframework\.data\:spring-data-elasticsearch\:.*`.
1663+
This indicates that the scanned application might be affected.
1664+
remediation:
1665+
description: |-
1666+
[IMPORTANT]
1667+
====
1668+
This section has been automatically generated from the https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Migration-Guide#elasticsearch-clients-and-templates[Spring Boot 3.0 Migration Guide^, role="ext-link"]. +
1669+
**Please consider contributing to issue https://github.com/spring-projects-experimental/spring-boot-migrator/issues/688[#688^, role="ext-link"]**
1670+
====
1671+
projects:
1672+
- spring-data
1673+
gitHubIssue: 688
1674+
# contributors:
1675+
# - Your Name[@your-gh-handle]
1676+
1677+
16391678
footer: |-
16401679
We want to say thank you to all Contributors:
16411680
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
/*
2+
* Copyright 2021 - 2022 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package org.springframework.sbm.boot.upgrade_27_30.report.helper;
17+
18+
import org.junit.jupiter.api.Test;
19+
import org.junit.jupiter.api.DisplayName;
20+
import org.springframework.sbm.boot.upgrade_27_30.report.SpringBootUpgradeReportTestSupport;
21+
import org.springframework.sbm.engine.context.ProjectContext;
22+
import org.springframework.sbm.project.resource.TestProjectContext;
23+
24+
class ElasticsearchClientsAndTemplatesReportSectionTest {
25+
@Test
26+
@DisplayName("Elasticsearch Clients and Templates should render")
27+
void withSingleModuleApplicationShouldRender() {
28+
ProjectContext context = TestProjectContext
29+
.buildProjectContext()
30+
.withSpringBootParentOf("2.7.5")
31+
.withBuildFileHavingDependencies("org.springframework.data:spring-data-elasticsearch:4.4.6")
32+
.build();
33+
34+
SpringBootUpgradeReportTestSupport.generatedSection("Elasticsearch Clients and Templates")
35+
.fromProjectContext(context)
36+
.shouldRenderAs("""
37+
=== Elasticsearch Clients and Templates
38+
39+
==== What Changed
40+
Support for Elasticsearch's high-level REST client has been removed.
41+
In its place, auto-configuration for Elasticsearch's new Java client has been introduced.
42+
Similarly, support for the Spring Data Elasticsearch templates that built on top of the high-level REST client has been removed.
43+
In its place, auto-configuration for the new templates that build upon the new Java client has been introduced.
44+
See https://docs.spring.io/spring-data/elasticsearch/docs/current/reference/html/#elasticsearch.clients[the Elasticsearch section of the reference documentation] for further details.
45+
46+
`ReactiveElasticsearchRestClientAutoConfiguration` has been renamed to `ReactiveElasticsearchClientAutoConfiguration` and has moved from `org.springframework.boot.autoconfigure.data.elasticsearch` to `org.springframework.boot.autoconfigure.elasticsearch`.
47+
Any auto-configuration exclusions or ordering should be updated accordingly.
48+
49+
==== Why is the application affected
50+
Actually, we don't know if the scanned application is really affected by this change.
51+
But we found a dependency matching regex `org\\.springframework\\.data\\:spring-data-elasticsearch\\:.*`.
52+
This indicates that the scanned application might be affected.
53+
54+
==== Remediation
55+
[IMPORTANT]
56+
====
57+
This section has been automatically generated from the https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Migration-Guide#elasticsearch-clients-and-templates[Spring Boot 3.0 Migration Guide^, role="ext-link"]. +
58+
**Please consider contributing to issue https://github.com/spring-projects-experimental/spring-boot-migrator/issues/688[#688^, role="ext-link"]**
59+
====
60+
61+
62+
""");
63+
}
64+
65+
@Test
66+
@DisplayName("Elasticsearch Clients and Templates should not render")
67+
void shouldNotRender() {
68+
ProjectContext context = TestProjectContext
69+
.buildProjectContext()
70+
.build();
71+
72+
SpringBootUpgradeReportTestSupport.generatedSection("Elasticsearch Clients and Templates")
73+
.fromProjectContext(context)
74+
.shouldNotRender();
75+
}
76+
}

0 commit comments

Comments
 (0)