Browse Source

Polish "Use generic wildcard for Pulsar beans"

See gh-39308
pull/39389/head
Moritz Halbritter 2 years ago
parent
commit
cee249197f
  1. 13
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/pulsar/PulsarAutoConfigurationTests.java

13
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/pulsar/PulsarAutoConfigurationTests.java

@ -377,9 +377,10 @@ class PulsarAutoConfigurationTests { @@ -377,9 +377,10 @@ class PulsarAutoConfigurationTests {
@Test
void injectsExpectedBeanWithExplicitGenericType() {
this.contextRunner.withBean(ExplicitGenericTypeConfig.class)
.run((context) -> assertThat(context).getBean(ExplicitGenericTypeConfig.class)
.hasFieldOrPropertyWithValue("consumerFactory", context.getBean(PulsarConsumerFactory.class))
.hasFieldOrPropertyWithValue("containerFactory", context.getBean(ConcurrentPulsarListenerContainerFactory.class)));
.run((context) -> assertThat(context).getBean(ExplicitGenericTypeConfig.class)
.hasFieldOrPropertyWithValue("consumerFactory", context.getBean(PulsarConsumerFactory.class))
.hasFieldOrPropertyWithValue("containerFactory",
context.getBean(ConcurrentPulsarListenerContainerFactory.class)));
}
@TestConfiguration(proxyBeanMethods = false)
@ -400,13 +401,17 @@ class PulsarAutoConfigurationTests { @@ -400,13 +401,17 @@ class PulsarAutoConfigurationTests {
}
static class ExplicitGenericTypeConfig {
@Autowired
PulsarConsumerFactory<TestType> consumerFactory;
@Autowired
ConcurrentPulsarListenerContainerFactory<TestType> containerFactory;
static class TestType {}
static class TestType {
}
}
}

Loading…
Cancel
Save