Merge branch '2.4.x'

This commit is contained in:
Phillip Webb
2021-01-11 12:05:01 -08:00
6 changed files with 14 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.
@@ -1274,6 +1274,7 @@ public class SpringApplication {
/**
* Set the {@link ApplicationStartup} to use for collecting startup metrics.
* @param applicationStartup the application startup to use
* @since 2.4.0
*/
public void setApplicationStartup(ApplicationStartup applicationStartup) {
this.applicationStartup = (applicationStartup != null) ? applicationStartup : ApplicationStartup.DEFAULT;
@@ -1282,6 +1283,7 @@ public class SpringApplication {
/**
* Returns the {@link ApplicationStartup} used for collecting startup metrics.
* @return the application startup
* @since 2.4.0
*/
public ApplicationStartup getApplicationStartup() {
return this.applicationStartup;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 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.
@@ -78,6 +78,7 @@ public interface Origin {
* @param source the source object or {@code null}
* @return a list of parents or an empty list if the source is {@code null}, has no
* origin, or no parent
* @since 2.4.0
*/
static List<Origin> parentsFrom(Object source) {
Origin origin = from(source);

View File

@@ -630,8 +630,14 @@ class ConfigDataEnvironmentPostProcessorIntegrationTests {
@Test
void runWhenHasIncludedProfilesWithProfileSpecificDocumentThrowsException() {
assertThatExceptionOfType(InactiveConfigDataAccessException.class).isThrownBy(() -> this.application.run(
"--spring.config.location=classpath:application-include-profiles-in-profile-specific-document.properties"));
}
@Test
void runWhenHasIncludedProfilesWithProfileSpecificFileThrowsException() {
assertThatExceptionOfType(InactiveConfigDataAccessException.class).isThrownBy(() -> this.application
.run("--spring.config.location=classpath:application-include-profiles-in-profile-specific.properties"));
.run("--spring.config.name=application-include-profiles-in-profile-specific-document"));
}
@Test