From ebdebbbd065389904f7820e4ab6a172af6e6963e Mon Sep 17 00:00:00 2001 From: rstoyanchev Date: Mon, 31 Mar 2025 15:20:30 +0100 Subject: [PATCH] Rename HttpServiceGroups to ImportHttpServiceGroups See gh-33992 --- .../service/registry/AbstractHttpServiceRegistrar.java | 1 + .../service/registry/AnnotationHttpServiceRegistrar.java | 4 +++- .../web/service/registry/HttpServiceGroup.java | 4 ++-- .../web/service/registry/HttpServiceGroupConfigurer.java | 1 + .../web/service/registry/HttpServiceProxyRegistry.java | 1 + .../registry/HttpServiceProxyRegistryFactoryBean.java | 1 + ...ttpServiceGroups.java => ImportHttpServiceGroups.java} | 3 ++- .../web/service/registry/ImportHttpServices.java | 4 ++-- .../registry/AnnotationHttpServiceRegistrarTests.java | 2 +- .../support/WebClientProxyRegistryIntegrationTests.java | 8 ++++---- 10 files changed, 18 insertions(+), 11 deletions(-) rename spring-web/src/main/java/org/springframework/web/service/registry/{HttpServiceGroups.java => ImportHttpServiceGroups.java} (96%) diff --git a/spring-web/src/main/java/org/springframework/web/service/registry/AbstractHttpServiceRegistrar.java b/spring-web/src/main/java/org/springframework/web/service/registry/AbstractHttpServiceRegistrar.java index ebe6b36c887..02c0101b6ca 100644 --- a/spring-web/src/main/java/org/springframework/web/service/registry/AbstractHttpServiceRegistrar.java +++ b/spring-web/src/main/java/org/springframework/web/service/registry/AbstractHttpServiceRegistrar.java @@ -68,6 +68,7 @@ import org.springframework.web.service.annotation.HttpExchange; * * @author Rossen Stoyanchev * @author Phillip Webb + * @author Olga Maciaszek-Sharma * @since 7.0 * @see ImportHttpServices * @see HttpServiceProxyRegistryFactoryBean diff --git a/spring-web/src/main/java/org/springframework/web/service/registry/AnnotationHttpServiceRegistrar.java b/spring-web/src/main/java/org/springframework/web/service/registry/AnnotationHttpServiceRegistrar.java index 418940fd198..72635aa974a 100644 --- a/spring-web/src/main/java/org/springframework/web/service/registry/AnnotationHttpServiceRegistrar.java +++ b/spring-web/src/main/java/org/springframework/web/service/registry/AnnotationHttpServiceRegistrar.java @@ -25,6 +25,8 @@ import org.springframework.core.type.AnnotationMetadata; * to determine the HTTP services and groups to register. * * @author Rossen Stoyanchev + * @author Phillip Webb + * @author Olga Maciaszek-Sharma * @since 7.0 */ class AnnotationHttpServiceRegistrar extends AbstractHttpServiceRegistrar { @@ -32,7 +34,7 @@ class AnnotationHttpServiceRegistrar extends AbstractHttpServiceRegistrar { @Override protected void registerHttpServices(GroupRegistry registry, AnnotationMetadata importMetadata) { - MergedAnnotation groupsAnnot = importMetadata.getAnnotations().get(HttpServiceGroups.class); + MergedAnnotation groupsAnnot = importMetadata.getAnnotations().get(ImportHttpServiceGroups.class); if (groupsAnnot.isPresent()) { HttpServiceGroup.ClientType clientType = groupsAnnot.getEnum("clientType", HttpServiceGroup.ClientType.class); for (MergedAnnotation annot : groupsAnnot.getAnnotationArray("value", ImportHttpServices.class)) { diff --git a/spring-web/src/main/java/org/springframework/web/service/registry/HttpServiceGroup.java b/spring-web/src/main/java/org/springframework/web/service/registry/HttpServiceGroup.java index 0f8c1453f85..858197023b3 100644 --- a/spring-web/src/main/java/org/springframework/web/service/registry/HttpServiceGroup.java +++ b/spring-web/src/main/java/org/springframework/web/service/registry/HttpServiceGroup.java @@ -23,8 +23,8 @@ import java.util.Set; * {@link org.springframework.web.service.invoker.HttpServiceProxyFactory} and * HTTP client setup. * - * @author Olga Maciaszek-Sharma * @author Rossen Stoyanchev + * @author Olga Maciaszek-Sharma * @since 7.0 */ public interface HttpServiceGroup { @@ -70,7 +70,7 @@ public interface HttpServiceGroup { /** * Not specified, falling back on a default. * @see ImportHttpServices#clientType() - * @see HttpServiceGroups#clientType() + * @see ImportHttpServiceGroups#clientType() * @see AbstractHttpServiceRegistrar#setDefaultClientType */ UNSPECIFIED; diff --git a/spring-web/src/main/java/org/springframework/web/service/registry/HttpServiceGroupConfigurer.java b/spring-web/src/main/java/org/springframework/web/service/registry/HttpServiceGroupConfigurer.java index f2a9320ae42..92f22a15c37 100644 --- a/spring-web/src/main/java/org/springframework/web/service/registry/HttpServiceGroupConfigurer.java +++ b/spring-web/src/main/java/org/springframework/web/service/registry/HttpServiceGroupConfigurer.java @@ -26,6 +26,7 @@ import org.springframework.web.service.invoker.HttpServiceProxyFactory; * Callback to configure the set of declared {@link HttpServiceGroup}s. * * @author Rossen Stoyanchev + * @author Olga Maciaszek-Sharma * @since 7.0 * @param the type of client builder, i.e. {@code RestClient} or {@code WebClient} builder. */ diff --git a/spring-web/src/main/java/org/springframework/web/service/registry/HttpServiceProxyRegistry.java b/spring-web/src/main/java/org/springframework/web/service/registry/HttpServiceProxyRegistry.java index eda52bf88f5..29f8c330e14 100644 --- a/spring-web/src/main/java/org/springframework/web/service/registry/HttpServiceProxyRegistry.java +++ b/spring-web/src/main/java/org/springframework/web/service/registry/HttpServiceProxyRegistry.java @@ -22,6 +22,7 @@ import org.jspecify.annotations.Nullable; * A registry that contains HTTP Service client proxies. * * @author Rossen Stoyanchev + * @author Olga Maciaszek-Sharma * @since 7.0 * @see ImportHttpServices * @see HttpServiceProxyRegistryFactoryBean diff --git a/spring-web/src/main/java/org/springframework/web/service/registry/HttpServiceProxyRegistryFactoryBean.java b/spring-web/src/main/java/org/springframework/web/service/registry/HttpServiceProxyRegistryFactoryBean.java index 177ca207f0b..f3942e31a6f 100644 --- a/spring-web/src/main/java/org/springframework/web/service/registry/HttpServiceProxyRegistryFactoryBean.java +++ b/spring-web/src/main/java/org/springframework/web/service/registry/HttpServiceProxyRegistryFactoryBean.java @@ -52,6 +52,7 @@ import org.springframework.web.service.invoker.HttpServiceProxyFactory; * * @author Rossen Stoyanchev * @author Phillip Webb + * @author Olga Maciaszek-Sharma * @since 7.0 * @see AbstractHttpServiceRegistrar */ diff --git a/spring-web/src/main/java/org/springframework/web/service/registry/HttpServiceGroups.java b/spring-web/src/main/java/org/springframework/web/service/registry/ImportHttpServiceGroups.java similarity index 96% rename from spring-web/src/main/java/org/springframework/web/service/registry/HttpServiceGroups.java rename to spring-web/src/main/java/org/springframework/web/service/registry/ImportHttpServiceGroups.java index e1f2cce9f91..d8cabb86fde 100644 --- a/spring-web/src/main/java/org/springframework/web/service/registry/HttpServiceGroups.java +++ b/spring-web/src/main/java/org/springframework/web/service/registry/ImportHttpServiceGroups.java @@ -32,6 +32,7 @@ import org.springframework.core.annotation.AliasFor; * may be used to set the {@link #clientType()} and that would be inherited by * all nested annotations. * + * @author Olga Maciaszek-Sharma * @author Rossen Stoyanchev * @since 7.0 */ @@ -39,7 +40,7 @@ import org.springframework.core.annotation.AliasFor; @Retention(RetentionPolicy.RUNTIME) @Documented @Import(AnnotationHttpServiceRegistrar.class) -public @interface HttpServiceGroups { +public @interface ImportHttpServiceGroups { /** * Alias for {@link #groups()}. diff --git a/spring-web/src/main/java/org/springframework/web/service/registry/ImportHttpServices.java b/spring-web/src/main/java/org/springframework/web/service/registry/ImportHttpServices.java index 78741be1ca2..5e656a2a372 100644 --- a/spring-web/src/main/java/org/springframework/web/service/registry/ImportHttpServices.java +++ b/spring-web/src/main/java/org/springframework/web/service/registry/ImportHttpServices.java @@ -46,12 +46,12 @@ import org.springframework.web.service.annotation.HttpExchange; * @author Olga Maciaszek-Sharma * @author Rossen Stoyanchev * @since 7.0 - * @see HttpServiceGroups + * @see ImportHttpServiceGroups * @see AbstractHttpServiceRegistrar */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) -@Repeatable(HttpServiceGroups.class) +@Repeatable(ImportHttpServiceGroups.class) @Import(AnnotationHttpServiceRegistrar.class) @Documented public @interface ImportHttpServices { diff --git a/spring-web/src/test/java/org/springframework/web/service/registry/AnnotationHttpServiceRegistrarTests.java b/spring-web/src/test/java/org/springframework/web/service/registry/AnnotationHttpServiceRegistrarTests.java index f87bbdd1a92..4be7150c743 100644 --- a/spring-web/src/test/java/org/springframework/web/service/registry/AnnotationHttpServiceRegistrarTests.java +++ b/spring-web/src/test/java/org/springframework/web/service/registry/AnnotationHttpServiceRegistrarTests.java @@ -97,7 +97,7 @@ public class AnnotationHttpServiceRegistrarTests { private static class ScanConfig { } - @HttpServiceGroups(clientType = ClientType.WEB_CLIENT, groups = { + @ImportHttpServiceGroups(clientType = ClientType.WEB_CLIENT, groups = { @ImportHttpServices(group = ECHO_GROUP, types = {EchoA.class}), @ImportHttpServices(group = GREETING_GROUP, types = {GreetingA.class}) }) diff --git a/spring-webflux/src/test/java/org/springframework/web/reactive/function/client/support/WebClientProxyRegistryIntegrationTests.java b/spring-webflux/src/test/java/org/springframework/web/reactive/function/client/support/WebClientProxyRegistryIntegrationTests.java index 29d7f1f0ed0..ff1a4f3be0f 100644 --- a/spring-webflux/src/test/java/org/springframework/web/reactive/function/client/support/WebClientProxyRegistryIntegrationTests.java +++ b/spring-webflux/src/test/java/org/springframework/web/reactive/function/client/support/WebClientProxyRegistryIntegrationTests.java @@ -37,9 +37,9 @@ import org.springframework.web.reactive.function.client.support.greeting.Greetin import org.springframework.web.reactive.function.client.support.greeting.GreetingB; import org.springframework.web.service.registry.AbstractHttpServiceRegistrar; import org.springframework.web.service.registry.HttpServiceGroup.ClientType; -import org.springframework.web.service.registry.HttpServiceGroups; -import org.springframework.web.service.registry.HttpServiceProxyRegistry; import org.springframework.web.service.registry.ImportHttpServices; +import org.springframework.web.service.registry.ImportHttpServiceGroups; +import org.springframework.web.service.registry.HttpServiceProxyRegistry; import static org.assertj.core.api.Assertions.assertThat; @@ -126,7 +126,7 @@ public class WebClientProxyRegistryIntegrationTests { @Configuration(proxyBeanMethods = false) - @HttpServiceGroups(clientType = ClientType.WEB_CLIENT, groups = { + @ImportHttpServiceGroups(clientType = ClientType.WEB_CLIENT, groups = { @ImportHttpServices(group = "echo", types = {EchoA.class, EchoB.class}), @ImportHttpServices(group = "greeting", types = {GreetingA.class, GreetingB.class}) }) @@ -135,7 +135,7 @@ public class WebClientProxyRegistryIntegrationTests { @Configuration(proxyBeanMethods = false) - @HttpServiceGroups(clientType = ClientType.WEB_CLIENT, groups = { + @ImportHttpServiceGroups(clientType = ClientType.WEB_CLIENT, groups = { @ImportHttpServices(group = "echo", basePackageClasses = EchoA.class), @ImportHttpServices(group = "greeting", basePackageClasses = GreetingA.class) })