Closes gh-12981
pull/13061/head
Johnny Lim 7 years ago committed by Stephane Nicoll
parent f2d8ca8b3a
commit b941c5f1a6

@ -47,7 +47,7 @@ public class ReactiveWebServerFactoryAutoConfigurationTests {
@Test
public void createFromConfigClass() {
this.contextRunner.withUserConfiguration(MockWebServerAutoConfiguration.class,
this.contextRunner.withUserConfiguration(MockWebServerConfiguration.class,
HttpHandlerConfiguration.class).run((context) -> {
assertThat(context.getBeansOfType(ReactiveWebServerFactory.class))
.hasSize(1);
@ -61,7 +61,7 @@ public class ReactiveWebServerFactoryAutoConfigurationTests {
@Test
public void missingHttpHandler() {
this.contextRunner.withUserConfiguration(MockWebServerAutoConfiguration.class)
this.contextRunner.withUserConfiguration(MockWebServerConfiguration.class)
.run((context) -> assertThat(context.getStartupFailure())
.isInstanceOf(ApplicationContextException.class)
.hasMessageContaining("missing HttpHandler bean"));
@ -70,7 +70,7 @@ public class ReactiveWebServerFactoryAutoConfigurationTests {
@Test
public void multipleHttpHandler() {
this.contextRunner
.withUserConfiguration(MockWebServerAutoConfiguration.class,
.withUserConfiguration(MockWebServerConfiguration.class,
HttpHandlerConfiguration.class, TooManyHttpHandlers.class)
.run((context) -> assertThat(context.getStartupFailure())
.isInstanceOf(ApplicationContextException.class)
@ -80,7 +80,7 @@ public class ReactiveWebServerFactoryAutoConfigurationTests {
@Test
public void customizeReactiveWebServer() {
this.contextRunner.withUserConfiguration(MockWebServerAutoConfiguration.class,
this.contextRunner.withUserConfiguration(MockWebServerConfiguration.class,
HttpHandlerConfiguration.class, ReactiveWebServerCustomization.class)
.run((context) -> assertThat(
context.getBean(MockReactiveWebServerFactory.class).getPort())
@ -128,7 +128,7 @@ public class ReactiveWebServerFactoryAutoConfigurationTests {
}
@Configuration
public static class MockWebServerAutoConfiguration {
public static class MockWebServerConfiguration {
@Bean
public MockReactiveWebServerFactory mockReactiveWebServerFactory() {

@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -66,7 +66,7 @@ public class OptionalLiveReloadServer implements InitializingBean {
}
/**
* Trigger LiveReload if the server is up an running.
* Trigger LiveReload if the server is up and running.
*/
public void triggerReload() {
if (this.server != null) {

@ -782,7 +782,7 @@ content into your application. Rather, pick only the properties that you need.
spring.jta.atomikos.datasource.xa-data-source-class-name= # Vendor-specific implementation of XAConnectionFactory.
spring.jta.atomikos.datasource.xa-properties= # Vendor-specific XA properties.
spring.jta.atomikos.properties.allow-sub-transactions=true # Specify whether sub-transactions are allowed.
spring.jta.atomikos.properties.checkpoint-interval=500 # Interval between checkpoints, expressed as the number of log writes between two checkpoint.
spring.jta.atomikos.properties.checkpoint-interval=500 # Interval between checkpoints, expressed as the number of log writes between two checkpoints.
spring.jta.atomikos.properties.default-jta-timeout=10000ms # Default timeout for JTA transactions.
spring.jta.atomikos.properties.default-max-wait-time-on-shutdown=9223372036854775807 # How long should normal shutdown (no-force) wait for transactions to complete.
spring.jta.atomikos.properties.enable-logging=true # Whether to enable disk logging.

@ -1216,7 +1216,7 @@ If the `dev` profile is enabled, however, `map` contains two entries with keys `
(with a name of `dev name 1` and a description of `my description 1`) and
`key2` (with a name of `dev name 2` and a description of `dev description 2`).
NOTE: The preceeding merging rules apply to properties from all property sources and not just
NOTE: The preceding merging rules apply to properties from all property sources and not just
YAML files.
[[boot-features-external-config-conversion]]

@ -72,11 +72,11 @@ public class ApplicationConversionService extends FormattingConversionService {
}
/**
* Configure the given {@link FormatterRegistry} with formatters and converts
* Configure the given {@link FormatterRegistry} with formatters and converters
* appropriate for most Spring Boot applications.
* @param registry the registry of converters to add to (must also be castable to
* ConversionService, e.g. being a {@link ConfigurableConversionService})
* @throws ClassCastException if the given ConverterRegistry could not be cast to a
* @throws ClassCastException if the given FormatterRegistry could not be cast to a
* ConversionService
*/
public static void configure(FormatterRegistry registry) {
@ -88,7 +88,6 @@ public class ApplicationConversionService extends FormattingConversionService {
/**
* Add converters useful for most Spring Boot applications.
* {@link DefaultConversionService#addDefaultConverters(ConverterRegistry)}
* @param registry the registry of converters to add to (must also be castable to
* ConversionService, e.g. being a {@link ConfigurableConversionService})
* @throws ClassCastException if the given ConverterRegistry could not be cast to a

@ -32,7 +32,7 @@ import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
/**
* Configure the HTTP compression on an Reactor Netty request/response handler.
* Configure the HTTP compression on a Reactor Netty request/response handler.
*
* @author Stephane Maldini
* @author Phillip Webb

@ -85,17 +85,17 @@ class ApplicationBuilder {
if (resourcesJar.exists()) {
return resourcesJar;
}
JarOutputStream resourcesJarStream = new JarOutputStream(
new FileOutputStream(resourcesJar));
try (JarOutputStream resourcesJarStream = new JarOutputStream(
new FileOutputStream(resourcesJar))) {
resourcesJarStream.putNextEntry(new ZipEntry("META-INF/resources/"));
resourcesJarStream.closeEntry();
resourcesJarStream.putNextEntry(
new ZipEntry("META-INF/resources/nested-meta-inf-resource.txt"));
resourcesJarStream.write("nested".getBytes());
resourcesJarStream.closeEntry();
resourcesJarStream.close();
return resourcesJar;
}
}
private void writePom(File appFolder, File resourcesJar) throws IOException {
Map<String, Object> context = new HashMap<>();
@ -103,11 +103,12 @@ class ApplicationBuilder {
context.put("container", this.container);
context.put("bootVersion", Versions.getBootVersion());
context.put("resourcesJarPath", resourcesJar.getAbsolutePath());
FileWriter out = new FileWriter(new File(appFolder, "pom.xml"));
try (FileWriter out = new FileWriter(new File(appFolder, "pom.xml"));
FileReader templateReader = new FileReader("src/test/resources/pom-template.xml")) {
Mustache.compiler().escapeHTML(false)
.compile(new FileReader("src/test/resources/pom-template.xml"))
.compile(templateReader)
.execute(context, out);
out.close();
}
}
private File writeSettingsXml(File appFolder) throws IOException {
@ -118,9 +119,10 @@ class ApplicationBuilder {
Map<String, Object> context = new HashMap<>();
context.put("repository", repository);
File settingsXml = new File(appFolder, "settings.xml");
try (FileWriter out = new FileWriter(settingsXml)) {
try (FileWriter out = new FileWriter(settingsXml);
FileReader templateReader = new FileReader("src/test/resources/settings-template.xml")) {
Mustache.compiler().escapeHTML(false)
.compile(new FileReader("src/test/resources/settings-template.xml"))
.compile(templateReader)
.execute(context, out);
}
return settingsXml;

Loading…
Cancel
Save