From b0a95c850c521ebf6104c946f044ef9c1c43bd5b Mon Sep 17 00:00:00 2001 From: Niels de Bruin Date: Tue, 29 Oct 2024 15:09:22 +0100 Subject: [PATCH] Replace @Required on setters with @Autowired (#612) * Tests only * Reformat * Update src/main/java/org/openrewrite/java/spring/RequiredFieldIntoConstructorParameter.java Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update src/testWithSpringBoot_2_1/java/org/openrewrite/java/spring/RequiredFieldIntoConstructorParameterTest.java Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update src/testWithSpringBoot_2_1/java/org/openrewrite/java/spring/RequiredFieldIntoConstructorParameterTest.java Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update src/testWithSpringBoot_2_1/java/org/openrewrite/java/spring/RequiredFieldIntoConstructorParameterTest.java Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Polish test code * Polish code * Refactor test according to new specs * Add first version of recipe * Polish code * Remove recipe in favour of change type --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- src/main/resources/META-INF/rewrite/spring-framework-51.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/resources/META-INF/rewrite/spring-framework-51.yml b/src/main/resources/META-INF/rewrite/spring-framework-51.yml index 4ce5a5daa..9920ffe34 100644 --- a/src/main/resources/META-INF/rewrite/spring-framework-51.yml +++ b/src/main/resources/META-INF/rewrite/spring-framework-51.yml @@ -32,3 +32,7 @@ recipeList: artifactId: "*" newVersion: 5.1.x overrideManagedVersion: false + - org.openrewrite.java.ChangeType: + oldFullyQualifiedTypeName: org.springframework.beans.factory.annotation.Required + newFullyQualifiedTypeName: org.springframework.beans.factory.annotation.Autowired + ignoreDefinition: true