mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Polish "Use generic wildcard for Pulsar beans"
See gh-39308
This commit is contained in:
parent
c02dd14c66
commit
cee249197f
@ -377,9 +377,10 @@ class PulsarAutoConfigurationTests {
|
|||||||
@Test
|
@Test
|
||||||
void injectsExpectedBeanWithExplicitGenericType() {
|
void injectsExpectedBeanWithExplicitGenericType() {
|
||||||
this.contextRunner.withBean(ExplicitGenericTypeConfig.class)
|
this.contextRunner.withBean(ExplicitGenericTypeConfig.class)
|
||||||
.run((context) -> assertThat(context).getBean(ExplicitGenericTypeConfig.class)
|
.run((context) -> assertThat(context).getBean(ExplicitGenericTypeConfig.class)
|
||||||
.hasFieldOrPropertyWithValue("consumerFactory", context.getBean(PulsarConsumerFactory.class))
|
.hasFieldOrPropertyWithValue("consumerFactory", context.getBean(PulsarConsumerFactory.class))
|
||||||
.hasFieldOrPropertyWithValue("containerFactory", context.getBean(ConcurrentPulsarListenerContainerFactory.class)));
|
.hasFieldOrPropertyWithValue("containerFactory",
|
||||||
|
context.getBean(ConcurrentPulsarListenerContainerFactory.class)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestConfiguration(proxyBeanMethods = false)
|
@TestConfiguration(proxyBeanMethods = false)
|
||||||
@ -400,13 +401,17 @@ class PulsarAutoConfigurationTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static class ExplicitGenericTypeConfig {
|
static class ExplicitGenericTypeConfig {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
PulsarConsumerFactory<TestType> consumerFactory;
|
PulsarConsumerFactory<TestType> consumerFactory;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
ConcurrentPulsarListenerContainerFactory<TestType> containerFactory;
|
ConcurrentPulsarListenerContainerFactory<TestType> containerFactory;
|
||||||
|
|
||||||
static class TestType {}
|
static class TestType {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user