Rename HttpServiceGroups to ImportHttpServiceGroups

See gh-33992
This commit is contained in:
rstoyanchev
2025-03-31 15:20:30 +01:00
parent 779f1b080e
commit ebdebbbd06
10 changed files with 18 additions and 11 deletions

View File

@@ -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

View File

@@ -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)) {

View File

@@ -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;

View File

@@ -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 <CB> the type of client builder, i.e. {@code RestClient} or {@code WebClient} builder.
*/

View File

@@ -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

View File

@@ -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
*/

View File

@@ -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()}.

View File

@@ -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 {

View File

@@ -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})
})

View File

@@ -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)
})