Closes gh-14202
This commit is contained in:
Johnny Lim 2018-08-26 05:03:02 +09:00 committed by Stephane Nicoll
parent 2a016a47e2
commit fe3fe0fa63
4 changed files with 5 additions and 13 deletions

View File

@ -64,7 +64,7 @@ class DataSourceInitializedPublisher implements BeanPostProcessor {
throws BeansException { throws BeansException {
if (bean instanceof LocalContainerEntityManagerFactoryBean) { if (bean instanceof LocalContainerEntityManagerFactoryBean) {
LocalContainerEntityManagerFactoryBean factory = (LocalContainerEntityManagerFactoryBean) bean; LocalContainerEntityManagerFactoryBean factory = (LocalContainerEntityManagerFactoryBean) bean;
factory.setJpaVendorAdapter(new DataSourceSchemeCreatedPublisher(factory)); factory.setJpaVendorAdapter(new DataSourceSchemaCreatedPublisher(factory));
} }
return bean; return bean;
} }
@ -140,13 +140,13 @@ class DataSourceInitializedPublisher implements BeanPostProcessor {
} }
final class DataSourceSchemeCreatedPublisher implements JpaVendorAdapter { final class DataSourceSchemaCreatedPublisher implements JpaVendorAdapter {
private final JpaVendorAdapter delegate; private final JpaVendorAdapter delegate;
private final LocalContainerEntityManagerFactoryBean factory; private final LocalContainerEntityManagerFactoryBean factory;
private DataSourceSchemeCreatedPublisher( private DataSourceSchemaCreatedPublisher(
LocalContainerEntityManagerFactoryBean factory) { LocalContainerEntityManagerFactoryBean factory) {
this.delegate = factory.getJpaVendorAdapter(); this.delegate = factory.getJpaVendorAdapter();
this.factory = factory; this.factory = factory;

View File

@ -213,7 +213,7 @@ public class RestartClassLoaderTests {
private <T> List<T> toList(Enumeration<T> enumeration) { private <T> List<T> toList(Enumeration<T> enumeration) {
return (enumeration != null) ? Collections.list(enumeration) return (enumeration != null) ? Collections.list(enumeration)
: Collections.<T>emptyList(); : Collections.emptyList();
} }
} }

View File

@ -5645,7 +5645,7 @@ The following component creates a listener endpoint on the `someTopic` topic:
Spring for Apache Kafka provides a factory bean to create a `StreamsBuilder` object and Spring for Apache Kafka provides a factory bean to create a `StreamsBuilder` object and
manage the lifecycle of its streams. Spring Boot auto-configures the required manage the lifecycle of its streams. Spring Boot auto-configures the required
`KafkaStreamsConfiguration` bean as long as `kafka-streams` in on the classpath and kafka `KafkaStreamsConfiguration` bean as long as `kafka-streams` in on the classpath and kafka
streams is enabled via the @EnableKafkaStreams` annotation. streams is enabled via the `@EnableKafkaStreams` annotation.
Enabling Kafka Streams means that the application id and bootstrap servers must be set. Enabling Kafka Streams means that the application id and bootstrap servers must be set.
The former can be configured using `spring.kafka.streams.application-id`, defaulting to The former can be configured using `spring.kafka.streams.application-id`, defaulting to

View File

@ -31,20 +31,12 @@ public abstract class AbstractPropertyMapperTests {
protected abstract PropertyMapper getMapper(); protected abstract PropertyMapper getMapper();
protected final Iterator<String> namesFromString(String name) { protected final Iterator<String> namesFromString(String name) {
return namesFromString(name, "value");
}
protected final Iterator<String> namesFromString(String name, Object value) {
return Arrays.stream(getMapper().map(name)) return Arrays.stream(getMapper().map(name))
.map((mapping) -> mapping.getConfigurationPropertyName().toString()) .map((mapping) -> mapping.getConfigurationPropertyName().toString())
.iterator(); .iterator();
} }
protected final Iterator<String> namesFromConfiguration(String name) { protected final Iterator<String> namesFromConfiguration(String name) {
return namesFromConfiguration(name, "value");
}
protected final Iterator<String> namesFromConfiguration(String name, String value) {
return Arrays.stream(getMapper().map(ConfigurationPropertyName.of(name))) return Arrays.stream(getMapper().map(ConfigurationPropertyName.of(name)))
.map(PropertyMapping::getPropertySourceName).iterator(); .map(PropertyMapping::getPropertySourceName).iterator();
} }