pull/10948/merge
Phillip Webb 7 years ago
parent cf485ce144
commit f647f5689f

@ -52,8 +52,7 @@ public class ConditionsReportEndpoint {
private final ConditionEvaluationReport conditionEvaluationReport;
public ConditionsReportEndpoint(
ConditionEvaluationReport conditionEvaluationReport) {
public ConditionsReportEndpoint(ConditionEvaluationReport conditionEvaluationReport) {
this.conditionEvaluationReport = conditionEvaluationReport;
}

@ -34,8 +34,9 @@ import org.springframework.data.couchbase.repository.ReactiveCouchbaseRepository
* @since 2.0.0
*/
@Configuration
@ConditionalOnClass({Bucket.class, ReactiveCouchbaseRepository.class, Flux.class})
@ConditionalOnClass({ Bucket.class, ReactiveCouchbaseRepository.class, Flux.class })
@AutoConfigureAfter(CouchbaseDataAutoConfiguration.class)
@Import(SpringBootCouchbaseReactiveDataConfiguration.class)
public class CouchbaseReactiveDataAutoConfiguration {
}

@ -31,14 +31,14 @@ import org.springframework.data.couchbase.repository.config.ReactiveRepositoryOp
import org.springframework.data.couchbase.repository.support.ReactiveCouchbaseRepositoryFactoryBean;
/**
* {@link EnableAutoConfiguration Auto-configuration} for Spring Data's Couchbase
* Reactive Repositories.
* {@link EnableAutoConfiguration Auto-configuration} for Spring Data's Couchbase Reactive
* Repositories.
*
* @author Alex Derkach
* @since 2.0.0
*/
@Configuration
@ConditionalOnClass({Bucket.class, ReactiveCouchbaseRepository.class})
@ConditionalOnClass({ Bucket.class, ReactiveCouchbaseRepository.class })
@ConditionalOnProperty(prefix = "spring.data.couchbase.reactive-repositories", name = "enabled", havingValue = "true", matchIfMissing = true)
@ConditionalOnBean(ReactiveRepositoryOperationsMapping.class)
@ConditionalOnMissingBean(ReactiveCouchbaseRepositoryFactoryBean.class)

@ -69,7 +69,8 @@ class SpringBootCouchbaseReactiveDataConfiguration
@Override
@ConditionalOnMissingBean(name = BeanNames.REACTIVE_COUCHBASE_OPERATIONS_MAPPING)
@Bean(name = BeanNames.REACTIVE_COUCHBASE_OPERATIONS_MAPPING)
public ReactiveRepositoryOperationsMapping reactiveRepositoryOperationsMapping(RxJavaCouchbaseTemplate reactiveCouchbaseTemplate) throws Exception {
public ReactiveRepositoryOperationsMapping reactiveRepositoryOperationsMapping(
RxJavaCouchbaseTemplate reactiveCouchbaseTemplate) throws Exception {
return super.reactiveRepositoryOperationsMapping(reactiveCouchbaseTemplate);
}

@ -22,6 +22,7 @@ import org.springframework.boot.autoconfigure.data.couchbase.city.City;
import org.springframework.data.repository.Repository;
public interface ReactiveCityCouchbaseRepository extends Repository<City, Long> {
Mono<City> save(City city);
Mono<City> findById(Long id);

@ -73,7 +73,8 @@ public class CouchbaseReactiveDataAutoConfigurationTests {
@Test
public void customConfiguration() {
load(CustomCouchbaseConfiguration.class);
RxJavaCouchbaseTemplate rxJavaCouchbaseTemplate = this.context.getBean(RxJavaCouchbaseTemplate.class);
RxJavaCouchbaseTemplate rxJavaCouchbaseTemplate = this.context
.getBean(RxJavaCouchbaseTemplate.class);
assertThat(rxJavaCouchbaseTemplate.getDefaultConsistency())
.isEqualTo(Consistency.STRONGLY_CONSISTENT);
}
@ -81,8 +82,8 @@ public class CouchbaseReactiveDataAutoConfigurationTests {
@Test
public void validatorIsPresent() {
load(CouchbaseTestConfigurer.class);
assertThat(this.context.getBeansOfType(
ValidatingCouchbaseEventListener.class)).hasSize(1);
assertThat(this.context.getBeansOfType(ValidatingCouchbaseEventListener.class))
.hasSize(1);
}
@Test
@ -99,8 +100,8 @@ public class CouchbaseReactiveDataAutoConfigurationTests {
@Test
public void customConversions() {
load(CustomConversionsConfig.class);
RxJavaCouchbaseTemplate template = this.context.getBean(
RxJavaCouchbaseTemplate.class);
RxJavaCouchbaseTemplate template = this.context
.getBean(RxJavaCouchbaseTemplate.class);
assertThat(template.getConverter().getConversionService()
.canConvert(CouchbaseProperties.class, Boolean.class)).isTrue();
}
@ -113,13 +114,15 @@ public class CouchbaseReactiveDataAutoConfigurationTests {
}
context.register(PropertyPlaceholderAutoConfiguration.class,
ValidationAutoConfiguration.class, CouchbaseAutoConfiguration.class,
CouchbaseDataAutoConfiguration.class, CouchbaseReactiveDataAutoConfiguration.class);
CouchbaseDataAutoConfiguration.class,
CouchbaseReactiveDataAutoConfiguration.class);
context.refresh();
this.context = context;
}
@Configuration
static class CustomCouchbaseConfiguration extends AbstractReactiveCouchbaseDataConfiguration {
static class CustomCouchbaseConfiguration
extends AbstractReactiveCouchbaseDataConfiguration {
@Override
protected CouchbaseConfigurer couchbaseConfigurer() {

@ -92,12 +92,10 @@ public class CouchbaseReactiveRepositoriesAutoConfigurationTests {
context.register(config);
}
context.register(PropertyPlaceholderAutoConfiguration.class,
CouchbaseAutoConfiguration.class,
CouchbaseDataAutoConfiguration.class,
CouchbaseAutoConfiguration.class, CouchbaseDataAutoConfiguration.class,
CouchbaseRepositoriesAutoConfiguration.class,
CouchbaseReactiveDataAutoConfiguration.class,
CouchbaseReactiveRepositoriesAutoConfiguration.class
);
CouchbaseReactiveRepositoriesAutoConfiguration.class);
context.refresh();
this.context = context;
}
@ -122,4 +120,5 @@ public class CouchbaseReactiveRepositoriesAutoConfigurationTests {
protected static class CustomizedConfiguration {
}
}

@ -21,6 +21,7 @@ import reactor.core.publisher.Mono;
import org.springframework.data.repository.Repository;
public interface ReactiveCityRepository extends Repository<City, Long> {
Mono<City> save(City city);
Mono<City> findById(Long id);

@ -728,6 +728,8 @@ In the preceding example, when `my.servers` is redefined in several places, the
the `PropertySource` with higher precedence will override any other configuration for that list.
Both comma-separated lists and yaml lists can be used for completely overriding the contents of the list.
[[boot-features-external-config-exposing-yaml-to-spring]]
==== Exposing YAML as Properties in the Spring Environment
The `YamlPropertySourceLoader` class can be used to expose YAML as a `PropertySource` in

@ -222,13 +222,6 @@ public class TomcatServletWebServerFactory extends AbstractServletWebServerFacto
postProcessContext(context);
}
private void configureTldSkipPatterns(TomcatEmbeddedContext context) {
StandardJarScanFilter filter = new StandardJarScanFilter();
filter.setTldSkip(
StringUtils.collectionToCommaDelimitedString(this.tldSkipPatterns));
context.getJarScanner().setJarScanFilter(filter);
}
/**
* Override Tomcat's default locale mappings to align with other servers. See
* {@code org.apache.catalina.util.CharsetMapperDefault.properties}.
@ -250,6 +243,13 @@ public class TomcatServletWebServerFactory extends AbstractServletWebServerFacto
}
}
private void configureTldSkipPatterns(TomcatEmbeddedContext context) {
StandardJarScanFilter filter = new StandardJarScanFilter();
filter.setTldSkip(
StringUtils.collectionToCommaDelimitedString(this.tldSkipPatterns));
context.getJarScanner().setJarScanFilter(filter);
}
private void addDefaultServlet(Context context) {
Wrapper defaultServlet = context.createWrapper();
defaultServlet.setName("default");

@ -41,6 +41,7 @@ public class SampleJettySslApplicationTests {
@Autowired
private TestRestTemplate restTemplate;
@Autowired
private AbstractConfigurableWebServerFactory webServerFactory;
@ -55,4 +56,5 @@ public class SampleJettySslApplicationTests {
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
assertThat(entity.getBody()).isEqualTo("Hello World");
}
}

@ -52,10 +52,13 @@ public class SampleTomcatTwoConnectorsApplicationTests {
@LocalServerPort
private int port;
@Autowired
private Ports ports;
@Autowired
private TestRestTemplate restTemplate;
@Autowired
private AbstractConfigurableWebServerFactory webServerFactory;

@ -31,13 +31,7 @@ public class SampleController {
@GetMapping("/async")
public Callable<String> helloWorldAsync() {
return new Callable<String>() {
@Override
public String call() throws Exception {
return "async: Hello World";
}
};
return () -> "async: Hello World";
}
}

Loading…
Cancel
Save