diff --git a/default/generated/spring-framework/spring-framework-5.x-to-6.0-web-applications.yaml b/default/generated/spring-framework/spring-framework-5.x-to-6.0-web-applications.yaml index e1845182..8743ffcc 100644 --- a/default/generated/spring-framework/spring-framework-5.x-to-6.0-web-applications.yaml +++ b/default/generated/spring-framework/spring-framework-5.x-to-6.0-web-applications.yaml @@ -49,3 +49,35 @@ url: https://github.com/spring-projects/spring-framework/wiki/Spring-Framework-6.0-Release-Notes#web-applications - title: 'Specific Spring Framwork change' url: https://github.com/spring-projects/spring-framework/issues/28552 + +- ruleID: spring-framework-5.x-to-6.0-web-applications-00020 + category: mandatory + effort: 5 + labels: + - konveyor.io/source=spring5 + - konveyor.io/target=spring6+ + when: + and: + - java.referenced: + pattern: org.springframework.http.client.HttpComponentsClientHttpRequestFactory + - java.dependency: + name: org.apache.httpcomponents.httpclient + upperbound: 4.5.999999 + ignore: true + description: RestTemplate now requires Apache HttpClient 5 + message: | + `RestTemplate`, or rather the `HttpComponentsClientHttpRequestFactory`, now requires Apache HttpClient 5. + Please upgrade your HttpClient dependency, ideally to the latest version: + + ```xml + + org.apache.httpcomponents.client5 + httpclient5 + 5.4.1 + + ``` + links: + - title: 'Spring 6.0 migration guide' + url: https://github.com/spring-projects/spring-framework/wiki/Spring-Framework-6.0-Release-Notes#web-applications + - title: 'Apache HttpClient 4 to 5 migration guide' + url: https://hc.apache.org/httpcomponents-client-5.4.x/migration-guide/preparation.html diff --git a/default/generated/spring-framework/tests/data/web-applications/pom.xml b/default/generated/spring-framework/tests/data/web-applications/pom.xml index 8a03fa58..3e673f0b 100644 --- a/default/generated/spring-framework/tests/data/web-applications/pom.xml +++ b/default/generated/spring-framework/tests/data/web-applications/pom.xml @@ -55,6 +55,13 @@ 1.7.36 runtime + + + + org.apache.httpcomponents + httpclient + 4.5.4 + diff --git a/default/generated/spring-framework/tests/data/web-applications/src/main/java/org/konveyor/Main.java b/default/generated/spring-framework/tests/data/web-applications/src/main/java/org/konveyor/Main.java index 5224b76e..a467cdb0 100644 --- a/default/generated/spring-framework/tests/data/web-applications/src/main/java/org/konveyor/Main.java +++ b/default/generated/spring-framework/tests/data/web-applications/src/main/java/org/konveyor/Main.java @@ -1,11 +1,17 @@ package org.konveyor; -import java.beans.IntrospectionException; +import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; +import org.springframework.web.client.RestTemplate; + +import java.net.URI; public class Main { - public static void main(String[] args) throws IntrospectionException { + public static void main(String[] args) { + RestTemplate rest = new RestTemplate(); + rest.getForEntity(URI.create("http://www.example.com/"), Object.class); + HttpComponentsClientHttpRequestFactory factory = new HttpComponentsClientHttpRequestFactory(); } } diff --git a/default/generated/spring-framework/tests/spring-framework-5.x-to-6.0-web-applications.test.yaml b/default/generated/spring-framework/tests/spring-framework-5.x-to-6.0-web-applications.test.yaml index 114eb706..2a049989 100644 --- a/default/generated/spring-framework/tests/spring-framework-5.x-to-6.0-web-applications.test.yaml +++ b/default/generated/spring-framework/tests/spring-framework-5.x-to-6.0-web-applications.test.yaml @@ -10,3 +10,10 @@ tests: mode: "source-only" hasIncidents: exactly: 1 +- ruleID: spring-framework-5.x-to-6.0-web-applications-00020 + testCases: + - name: tc-1 + analysisParams: + mode: "source-only" + hasIncidents: + exactly: 2