Polish
This commit is contained in:
@@ -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,20 +137,20 @@ public class JooqAutoConfigurationTests {
|
||||
this.contextRunner.withUserConfiguration(JooqDataSourceConfiguration.class,
|
||||
TxManagerConfiguration.class, TestRecordMapperProvider.class,
|
||||
TestRecordUnmapperProvider.class, TestRecordListenerProvider.class,
|
||||
TestExecuteListenerProvider.class, TestVisitListenerProvider.class
|
||||
).run((context) -> {
|
||||
DSLContext dsl = context.getBean(DSLContext.class);
|
||||
assertThat(dsl.configuration().recordMapperProvider().getClass())
|
||||
.isEqualTo(TestRecordMapperProvider.class);
|
||||
assertThat(dsl.configuration().recordUnmapperProvider().getClass())
|
||||
.isEqualTo(TestRecordUnmapperProvider.class);
|
||||
assertThat(dsl.configuration().recordListenerProviders().length)
|
||||
.isEqualTo(1);
|
||||
assertThat(dsl.configuration().executeListenerProviders().length)
|
||||
.isEqualTo(2);
|
||||
assertThat(dsl.configuration().visitListenerProviders().length)
|
||||
.isEqualTo(1);
|
||||
});
|
||||
TestExecuteListenerProvider.class, TestVisitListenerProvider.class)
|
||||
.run((context) -> {
|
||||
DSLContext dsl = context.getBean(DSLContext.class);
|
||||
assertThat(dsl.configuration().recordMapperProvider().getClass())
|
||||
.isEqualTo(TestRecordMapperProvider.class);
|
||||
assertThat(dsl.configuration().recordUnmapperProvider().getClass())
|
||||
.isEqualTo(TestRecordUnmapperProvider.class);
|
||||
assertThat(dsl.configuration().recordListenerProviders().length)
|
||||
.isEqualTo(1);
|
||||
assertThat(dsl.configuration().executeListenerProviders().length)
|
||||
.isEqualTo(2);
|
||||
assertThat(dsl.configuration().visitListenerProviders().length)
|
||||
.isEqualTo(1);
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user