mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Polish
See gh-30695
This commit is contained in:
parent
4c5cb772ff
commit
ed412af138
@ -41,7 +41,7 @@ import org.gradle.api.tasks.TaskAction;
|
|||||||
*/
|
*/
|
||||||
public class DocumentDevtoolsPropertyDefaults extends DefaultTask {
|
public class DocumentDevtoolsPropertyDefaults extends DefaultTask {
|
||||||
|
|
||||||
private Configuration devtools;
|
private final Configuration devtools;
|
||||||
|
|
||||||
private final RegularFileProperty outputFile;
|
private final RegularFileProperty outputFile;
|
||||||
|
|
||||||
|
@ -96,8 +96,7 @@ class ThymeleafReactiveAutoConfigurationTests {
|
|||||||
MediaType.APPLICATION_ATOM_XML, new MediaType("application", "javascript"),
|
MediaType.APPLICATION_ATOM_XML, new MediaType("application", "javascript"),
|
||||||
new MediaType("application", "ecmascript"), new MediaType("text", "javascript"),
|
new MediaType("application", "ecmascript"), new MediaType("text", "javascript"),
|
||||||
new MediaType("text", "ecmascript"), MediaType.APPLICATION_JSON,
|
new MediaType("text", "ecmascript"), MediaType.APPLICATION_JSON,
|
||||||
new MediaType("text", "css"), MediaType.TEXT_PLAIN, MediaType.TEXT_EVENT_STREAM)
|
new MediaType("text", "css"), MediaType.TEXT_PLAIN, MediaType.TEXT_EVENT_STREAM));
|
||||||
.satisfies(System.out::println));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -18,6 +18,7 @@ package org.springframework.boot.devtools.env;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
@ -74,7 +75,7 @@ public class DevToolsPropertyDefaultsPostProcessor implements EnvironmentPostPro
|
|||||||
for (String name : properties.stringPropertyNames()) {
|
for (String name : properties.stringPropertyNames()) {
|
||||||
map.put(name, properties.getProperty(name));
|
map.put(name, properties.getProperty(name));
|
||||||
}
|
}
|
||||||
PROPERTIES = map;
|
PROPERTIES = Collections.unmodifiableMap(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -20,7 +20,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.boot.test.autoconfigure.data.elasticsearch.DataElasticsearchTest;
|
import org.springframework.boot.test.autoconfigure.data.elasticsearch.DataElasticsearchTest;
|
||||||
|
|
||||||
@DataElasticsearchTest
|
@DataElasticsearchTest
|
||||||
public class MyDataElasticsearchTests {
|
class MyDataElasticsearchTests {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
|
@ -123,7 +123,7 @@ The preceding example sets the value of the `example` project property to `custo
|
|||||||
[[running-your-application.reloading-resources]]
|
[[running-your-application.reloading-resources]]
|
||||||
== Reloading Resources
|
== Reloading Resources
|
||||||
If devtools has been added to your project it will automatically monitor your application's classpath for changes.
|
If devtools has been added to your project it will automatically monitor your application's classpath for changes.
|
||||||
Note that modified files need to be recompiled for the classpath to update inorder to trigger reloading with devtools.
|
Note that modified files need to be recompiled for the classpath to update in order to trigger reloading with devtools.
|
||||||
For more details on using devtools, refer to {spring-boot-reference}#using.devtools.restart[this section of the reference documentation].
|
For more details on using devtools, refer to {spring-boot-reference}#using.devtools.restart[this section of the reference documentation].
|
||||||
|
|
||||||
Alternatively, you can configure `bootRun` such that your application's static resources are loaded from their source location:
|
Alternatively, you can configure `bootRun` such that your application's static resources are loaded from their source location:
|
||||||
|
@ -184,7 +184,7 @@ public class GradleBuild {
|
|||||||
buildOutput = buildOutput.replaceAll(message, "");
|
buildOutput = buildOutput.replaceAll(message, "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
assertThat(buildOutput).doesNotContain("Deprecated").doesNotContain("deprecated");
|
assertThat(buildOutput).doesNotContainIgnoringCase("deprecated");
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@ import org.springframework.core.env.Environment;
|
|||||||
import org.springframework.core.env.PropertySource;
|
import org.springframework.core.env.PropertySource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A {@link FailureAnalyzer} that performs analysis of failures caused by an
|
* A {@link FailureAnalyzer} that performs analysis of failures caused by a
|
||||||
* {@link MutuallyExclusiveConfigurationPropertiesException}.
|
* {@link MutuallyExclusiveConfigurationPropertiesException}.
|
||||||
*
|
*
|
||||||
* @author Andy Wilkinson
|
* @author Andy Wilkinson
|
||||||
|
@ -24,7 +24,7 @@ import org.springframework.boot.diagnostics.FailureAnalyzer;
|
|||||||
import org.springframework.core.annotation.Order;
|
import org.springframework.core.annotation.Order;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A {@link FailureAnalyzer} that performs analysis of failures caused by an
|
* A {@link FailureAnalyzer} that performs analysis of failures caused by a
|
||||||
* {@link MissingWebServerFactoryBeanException}.
|
* {@link MissingWebServerFactoryBeanException}.
|
||||||
*
|
*
|
||||||
* @author Guirong Hu
|
* @author Guirong Hu
|
||||||
|
@ -107,7 +107,7 @@ public class ReactiveWebServerApplicationContext extends GenericReactiveWebAppli
|
|||||||
// Use bean names so that we don't consider the hierarchy
|
// Use bean names so that we don't consider the hierarchy
|
||||||
String[] beanNames = getBeanFactory().getBeanNamesForType(ReactiveWebServerFactory.class);
|
String[] beanNames = getBeanFactory().getBeanNamesForType(ReactiveWebServerFactory.class);
|
||||||
if (beanNames.length == 0) {
|
if (beanNames.length == 0) {
|
||||||
throw new MissingWebServerFactoryBeanException(this.getClass(), ReactiveWebServerFactory.class,
|
throw new MissingWebServerFactoryBeanException(getClass(), ReactiveWebServerFactory.class,
|
||||||
WebApplicationType.REACTIVE);
|
WebApplicationType.REACTIVE);
|
||||||
}
|
}
|
||||||
if (beanNames.length > 1) {
|
if (beanNames.length > 1) {
|
||||||
|
@ -209,7 +209,7 @@ public class ServletWebServerApplicationContext extends GenericWebApplicationCon
|
|||||||
// Use bean names so that we don't consider the hierarchy
|
// Use bean names so that we don't consider the hierarchy
|
||||||
String[] beanNames = getBeanFactory().getBeanNamesForType(ServletWebServerFactory.class);
|
String[] beanNames = getBeanFactory().getBeanNamesForType(ServletWebServerFactory.class);
|
||||||
if (beanNames.length == 0) {
|
if (beanNames.length == 0) {
|
||||||
throw new MissingWebServerFactoryBeanException(this.getClass(), ServletWebServerFactory.class,
|
throw new MissingWebServerFactoryBeanException(getClass(), ServletWebServerFactory.class,
|
||||||
WebApplicationType.SERVLET);
|
WebApplicationType.SERVLET);
|
||||||
}
|
}
|
||||||
if (beanNames.length > 1) {
|
if (beanNames.length > 1) {
|
||||||
|
@ -31,7 +31,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
|||||||
*
|
*
|
||||||
* @author Andy Wilkinson
|
* @author Andy Wilkinson
|
||||||
*/
|
*/
|
||||||
public class SpringBootVersionTests {
|
class SpringBootVersionTests {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void getVersionShouldReturnVersionMatchingGradleProperties() throws IOException {
|
void getVersionShouldReturnVersionMatchingGradleProperties() throws IOException {
|
||||||
|
Loading…
Reference in New Issue
Block a user