mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Polishing contribution
Closes gh-35307
This commit is contained in:
+8
-9
@@ -68,8 +68,8 @@ public class ClientHttpServiceRegistrarTests {
|
||||
|
||||
@Test
|
||||
void registerWhenNoClientsDoesNotCreateBeans() {
|
||||
try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(NothingFoundConfiguration.class)) {
|
||||
assertThat(context.getBeanNamesForType(HttpServiceProxyRegistry.class)).isEmpty();
|
||||
try (AnnotationConfigApplicationContext cxt = new AnnotationConfigApplicationContext(NoOpImportConfig.class)) {
|
||||
assertThat(cxt.getBeanNamesForType(HttpServiceProxyRegistry.class)).isEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,18 +85,17 @@ public class ClientHttpServiceRegistrarTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@Import(NothingFoundRegistrar.class)
|
||||
static class NothingFoundConfiguration {
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@Import(NoOpRegistrar.class)
|
||||
static class NoOpImportConfig {
|
||||
}
|
||||
|
||||
static class NothingFoundRegistrar extends AbstractClientHttpServiceRegistrar {
|
||||
|
||||
static class NoOpRegistrar extends AbstractClientHttpServiceRegistrar {
|
||||
|
||||
@Override
|
||||
protected void registerHttpServices(GroupRegistry registry,
|
||||
AnnotationMetadata importingClassMetadata) {
|
||||
findAndRegisterHttpServiceClients(registry, List.of("com.example.missing.package"));
|
||||
protected void registerHttpServices(GroupRegistry registry, AnnotationMetadata metadata) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user