Format code

This commit is contained in:
Phillip Webb
2018-05-25 21:47:22 -07:00
parent e544922dd7
commit 9fd3b9103a
10 changed files with 26 additions and 24 deletions

View File

@@ -158,9 +158,10 @@ public class MetricsProperties {
/**
* Whether meter IDs starting with the specified name should publish percentile
* histograms. For monitoring systems that support aggregable percentile calculation
* based on a histogram, this can be set to true. For other systems, this has no effect. The
* longest match wins, the key `all` can also be used to configure all meters.
* histograms. For monitoring systems that support aggregable percentile
* calculation based on a histogram, this can be set to true. For other systems,
* this has no effect. The longest match wins, the key `all` can also be used to
* configure all meters.
*/
private Map<String, Boolean> percentilesHistogram = new LinkedHashMap<>();

View File

@@ -123,7 +123,8 @@ public class EndpointRequestTests {
endpoints.add(mockEndpoint("foo", "foo"));
endpoints.add(mockEndpoint("bar", "bar"));
endpoints.add(mockEndpoint("baz", "baz"));
PathMappedEndpoints pathMappedEndpoints = new PathMappedEndpoints("/actuator", () -> endpoints);
PathMappedEndpoints pathMappedEndpoints = new PathMappedEndpoints("/actuator",
() -> endpoints);
assertMatcher(matcher, pathMappedEndpoints).doesNotMatch("/actuator/foo");
assertMatcher(matcher, pathMappedEndpoints).doesNotMatch("/actuator/baz");
assertMatcher(matcher).matches("/actuator/bar");

View File

@@ -145,7 +145,8 @@ public class EndpointRequestTests {
endpoints.add(mockEndpoint("foo", "foo"));
endpoints.add(mockEndpoint("bar", "bar"));
endpoints.add(mockEndpoint("baz", "baz"));
PathMappedEndpoints pathMappedEndpoints = new PathMappedEndpoints("/actuator", () -> endpoints);
PathMappedEndpoints pathMappedEndpoints = new PathMappedEndpoints("/actuator",
() -> endpoints);
assertMatcher(matcher, pathMappedEndpoints).doesNotMatch("/actuator/foo");
assertMatcher(matcher, pathMappedEndpoints).doesNotMatch("/actuator/baz");
assertMatcher(matcher).matches("/actuator/bar");

View File

@@ -949,6 +949,7 @@ public class KafkaProperties {
"Resource '" + resource + "' must be on a file system", ex);
}
}
}
public static class Jaas {

View File

@@ -125,10 +125,9 @@ public class DefaultErrorWebExceptionHandler extends AbstractErrorWebExceptionHa
.just("error/" + errorStatus.toString(),
"error/" + SERIES_VIEWS.get(errorStatus.series()), "error/error")
.flatMap((viewName) -> renderErrorView(viewName, responseBody, error))
.switchIfEmpty(
this.errorProperties.getWhitelabel().isEnabled()
? renderDefaultErrorView(responseBody, error)
: Mono.error(getError(request)))
.switchIfEmpty(this.errorProperties.getWhitelabel().isEnabled()
? renderDefaultErrorView(responseBody, error)
: Mono.error(getError(request)))
.next().doOnNext((response) -> logError(request, errorStatus));
}

View File

@@ -72,7 +72,8 @@ public class DispatcherServletAutoConfigurationTests {
// from the default one, we're registering one anyway
@Test
public void registrationOverrideWithDispatcherServletWrongName() {
this.contextRunner.withUserConfiguration(CustomDispatcherServletDifferentName.class)
this.contextRunner
.withUserConfiguration(CustomDispatcherServletDifferentName.class)
.run((context) -> {
ServletRegistrationBean<?> registration = context
.getBean(ServletRegistrationBean.class);
@@ -89,8 +90,7 @@ public class DispatcherServletAutoConfigurationTests {
.run((context) -> {
ServletRegistrationBean<?> registration = context
.getBean(ServletRegistrationBean.class);
assertThat(registration.getUrlMappings())
.containsExactly("/foo");
assertThat(registration.getUrlMappings()).containsExactly("/foo");
assertThat(registration.getServletName())
.isEqualTo("customDispatcher");
assertThat(context).hasSingleBean(DispatcherServlet.class);

View File

@@ -76,10 +76,10 @@ public class SimpleMainTests {
}
private String[] getArgs(String... args) {
List<String> list = new ArrayList<>(Arrays.asList(
"--spring.main.web-application-type=none",
"--spring.main.show-banner=OFF",
"--spring.main.register-shutdownHook=false"));
List<String> list = new ArrayList<>(
Arrays.asList("--spring.main.web-application-type=none",
"--spring.main.show-banner=OFF",
"--spring.main.register-shutdownHook=false"));
if (args.length > 0) {
list.add("--spring.main.sources="
+ StringUtils.arrayToCommaDelimitedString(args));

View File

@@ -70,8 +70,7 @@ public class BindConverterTests {
@Test
public void createWhenPropertyEditorInitializerIsNullShouldCreate() {
new BindConverter(
ApplicationConversionService.getSharedInstance(), null);
new BindConverter(ApplicationConversionService.getSharedInstance(), null);
}
@Test

View File

@@ -89,8 +89,8 @@ public class ManagementPortAndPathSampleActuatorApplicationTests {
String unknownProperty = "test-does-not-exist";
assertThat(this.environment.containsProperty(unknownProperty)).isFalse();
ResponseEntity<String> entity = new TestRestTemplate()
.withBasicAuth("user", getPassword()).getForEntity(
"http://localhost:" + this.managementPort + "/admin/env/" + unknownProperty,
.withBasicAuth("user", getPassword()).getForEntity("http://localhost:"
+ this.managementPort + "/admin/env/" + unknownProperty,
String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.NOT_FOUND);
}

View File

@@ -48,12 +48,12 @@ public class SampleAntApplicationIT {
});
assertThat(jarFiles).hasSize(1);
Process process = new JavaExecutable().processBuilder("-jar", jarFiles[0]
.getName()).directory(target).start();
Process process = new JavaExecutable()
.processBuilder("-jar", jarFiles[0].getName()).directory(target).start();
process.waitFor(5, TimeUnit.MINUTES);
assertThat(process.exitValue()).isEqualTo(0);
String output = FileCopyUtils.copyToString(new InputStreamReader(process
.getInputStream()));
String output = FileCopyUtils
.copyToString(new InputStreamReader(process.getInputStream()));
assertThat(output).contains("Spring Boot Ant Example");
}