Commit 98a2a91d authored by Phillip Webb's avatar Phillip Webb

Polish

parent ebb2f70e
......@@ -40,7 +40,6 @@ public final class WebMvcTags {
private static final Tag URI_REDIRECTION = Tag.of("uri", "REDIRECTION");
private WebMvcTags() {
}
......@@ -110,10 +109,9 @@ public final class WebMvcTags {
}
private static String getPathInfo(HttpServletRequest request) {
String uri = StringUtils.hasText(request.getPathInfo()) ?
request.getPathInfo() : "/";
return uri.replaceAll("//+", "/")
.replaceAll("/$", "");
String pathInfo = request.getPathInfo();
String uri = (StringUtils.hasText(pathInfo) ? pathInfo : "/");
return uri.replaceAll("//+", "/").replaceAll("/$", "");
}
/**
......
......@@ -79,4 +79,5 @@ public class WebMvcTagsTests {
Tag tag = WebMvcTags.uri(null, null);
assertThat(tag.getValue()).isEqualTo("UNKNOWN");
}
}
......@@ -122,6 +122,7 @@ public class IntegrationAutoConfiguration {
@Configuration
@EnableIntegrationManagement(defaultCountsEnabled = "true")
protected static class EnableIntegrationManagementConfiguration {
}
}
......
......@@ -137,8 +137,8 @@ public class JooqAutoConfigurationTests {
this.contextRunner.withUserConfiguration(JooqDataSourceConfiguration.class,
TxManagerConfiguration.class, TestRecordMapperProvider.class,
TestRecordUnmapperProvider.class, TestRecordListenerProvider.class,
TestExecuteListenerProvider.class, TestVisitListenerProvider.class
).run((context) -> {
TestExecuteListenerProvider.class, TestVisitListenerProvider.class)
.run((context) -> {
DSLContext dsl = context.getBean(DSLContext.class);
assertThat(dsl.configuration().recordMapperProvider().getClass())
.isEqualTo(TestRecordMapperProvider.class);
......
......@@ -124,9 +124,9 @@ abstract class ArchiveCommand extends OptionParsingCommand {
protected ExitStatus run(OptionSet options) throws Exception {
List<?> nonOptionArguments = new ArrayList<Object>(
options.nonOptionArguments());
Assert.isTrue(nonOptionArguments.size() >= 2, () -> "The name of the "
+ "resulting " + this.type + " and at least one source file must be "
+ "specified");
Assert.isTrue(nonOptionArguments.size() >= 2,
() -> "The name of the " + "resulting " + this.type
+ " and at least one source file must be " + "specified");
File output = new File((String) nonOptionArguments.remove(0));
Assert.isTrue(
......
......@@ -112,9 +112,8 @@ public class ClassPathChangeUploader
FileCopyUtils.copy(bytes, request.getBody());
ClientHttpResponse response = request.execute();
HttpStatus statusCode = response.getStatusCode();
Assert.state(statusCode == HttpStatus.OK,
() -> "Unexpected " + statusCode
+ " response uploading class files");
Assert.state(statusCode == HttpStatus.OK, () -> "Unexpected "
+ statusCode + " response uploading class files");
logUpload(classLoaderFiles);
return;
}
......
......@@ -67,8 +67,8 @@ import org.springframework.util.StringUtils;
*/
public class ModifiedClassPathRunner extends BlockJUnit4ClassRunner {
private static final Pattern INTELLIJ_CLASSPATH_JAR_PATTERN = Pattern.compile(
".*classpath(\\d+)?.jar");
private static final Pattern INTELLIJ_CLASSPATH_JAR_PATTERN = Pattern
.compile(".*classpath(\\d+)?.jar");
public ModifiedClassPathRunner(Class<?> testClass) throws InitializationError {
super(testClass);
......@@ -147,7 +147,6 @@ public class ModifiedClassPathRunner extends BlockJUnit4ClassRunner {
return createdBy != null && createdBy.contains("IntelliJ");
}
catch (Exception ex) {
return false;
}
}
return false;
......@@ -168,8 +167,8 @@ public class ModifiedClassPathRunner extends BlockJUnit4ClassRunner {
private String[] getClassPath(URL booterJar) throws Exception {
Attributes attributes = getManifestMainAttributesFromUrl(booterJar);
return StringUtils.delimitedListToStringArray(attributes
.getValue(Attributes.Name.CLASS_PATH), " ");
return StringUtils.delimitedListToStringArray(
attributes.getValue(Attributes.Name.CLASS_PATH), " ");
}
private Attributes getManifestMainAttributesFromUrl(URL url) throws Exception {
......
/*
* 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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment