mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
Polish
Closes gh-13192
This commit is contained in:
parent
c271f8ef8b
commit
75639aa682
@ -16,10 +16,10 @@
|
||||
|
||||
package org.springframework.boot.actuate.health;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Base {@link HealthAggregator} implementation to allow subclasses to focus on
|
||||
@ -33,8 +33,8 @@ public abstract class AbstractHealthAggregator implements HealthAggregator {
|
||||
|
||||
@Override
|
||||
public final Health aggregate(Map<String, Health> healths) {
|
||||
List<Status> statusCandidates = new ArrayList<>();
|
||||
healths.values().forEach((health) -> statusCandidates.add(health.getStatus()));
|
||||
List<Status> statusCandidates = healths.values().stream()
|
||||
.map(Health::getStatus).collect(Collectors.toList());
|
||||
Status status = aggregateStatus(statusCandidates);
|
||||
Map<String, Object> details = aggregateDetails(healths);
|
||||
return new Health.Builder(status, details).build();
|
||||
|
@ -333,9 +333,9 @@
|
||||
<expandproperties />
|
||||
</filterchain>
|
||||
</copy>
|
||||
<attachartifact file="${project.build.directory}/homebrew/springboot.rb"
|
||||
classifier="homebrew" type="rb" />
|
||||
</target>
|
||||
<attachartifact file="${project.build.directory}/homebrew/springboot.rb"
|
||||
classifier="homebrew" type="rb" />
|
||||
</target>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
|
@ -1365,7 +1365,7 @@ use `setStatus(int)` rather `sendError(int)`. This prevents Jersey from committi
|
||||
response before Spring Security has had an opportunity to report an authentication or
|
||||
authorization failure to the client.
|
||||
|
||||
The `jersey.config.server.response.setStatusOverSendError` proeprty must be set to `true`
|
||||
The `jersey.config.server.response.setStatusOverSendError` property must be set to `true`
|
||||
on the application's `ResourceConfig` bean, as shown in the following example:
|
||||
|
||||
[source,java,indent=0]
|
||||
|
@ -68,7 +68,7 @@ import org.springframework.util.StringUtils;
|
||||
public class ModifiedClassPathRunner extends BlockJUnit4ClassRunner {
|
||||
|
||||
private static final Pattern INTELLIJ_CLASSPATH_JAR_PATTERN = Pattern
|
||||
.compile(".*classpath(\\d+)?.jar");
|
||||
.compile(".*classpath(\\d+)?\\.jar");
|
||||
|
||||
public ModifiedClassPathRunner(Class<?> testClass) throws InitializationError {
|
||||
super(testClass);
|
||||
|
@ -28,6 +28,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.servlet.Filter;
|
||||
import javax.servlet.MultipartConfigElement;
|
||||
@ -78,11 +79,9 @@ public class ServletContextInitializerBeans
|
||||
this.initializers = new LinkedMultiValueMap<>();
|
||||
addServletContextInitializerBeans(beanFactory);
|
||||
addAdaptableBeans(beanFactory);
|
||||
List<ServletContextInitializer> sortedInitializers = new ArrayList<>();
|
||||
this.initializers.values().forEach((contextInitializers) -> {
|
||||
AnnotationAwareOrderComparator.sort(contextInitializers);
|
||||
sortedInitializers.addAll(contextInitializers);
|
||||
});
|
||||
List<ServletContextInitializer> sortedInitializers = this.initializers.values().stream()
|
||||
.flatMap(value -> value.stream().sorted(AnnotationAwareOrderComparator.INSTANCE))
|
||||
.collect(Collectors.toList());
|
||||
this.sortedList = Collections.unmodifiableList(sortedInitializers);
|
||||
}
|
||||
|
||||
|
@ -107,12 +107,6 @@ public class MockConfigurationPropertySource
|
||||
return MockConfigurationPropertySource.this.getConfigurationProperty(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConfigurationPropertyState containsDescendantOf(
|
||||
ConfigurationPropertyName name) {
|
||||
return ConfigurationPropertyState.UNKNOWN;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user