Fix String formatted Exception message logging the Environment state in from(:Environment).
This commit is contained in:
@@ -98,8 +98,8 @@ public class VcapPropertySource extends PropertySource<EnumerablePropertySource<
|
||||
.map(propertySources -> propertySources.get(VCAP_PROPERTY_SOURCE_NAME))
|
||||
.map(VcapPropertySource::from)
|
||||
.orElseThrow(() -> newIllegalArgumentException(
|
||||
"Environment [%1$s] was not configurable or does not contain an enumerable [%2$s] PropertySource",
|
||||
environment, VCAP_PROPERTY_SOURCE_NAME));
|
||||
"Environment was not configurable or does not contain an enumerable [%s] PropertySource",
|
||||
VCAP_PROPERTY_SOURCE_NAME));
|
||||
}
|
||||
|
||||
public static VcapPropertySource from(Properties properties) {
|
||||
|
||||
@@ -89,9 +89,8 @@ public class VcapPropertySourceUnitTests {
|
||||
}
|
||||
catch (IllegalArgumentException expected) {
|
||||
|
||||
assertThat(expected).hasMessage(
|
||||
"Environment [%s] was not configurable or does not contain an enumerable [vcap] PropertySource",
|
||||
mockEnvironment);
|
||||
assertThat(expected)
|
||||
.hasMessage("Environment was not configurable or does not contain an enumerable [vcap] PropertySource");
|
||||
|
||||
assertThat(expected).hasNoCause();
|
||||
|
||||
@@ -117,9 +116,8 @@ public class VcapPropertySourceUnitTests {
|
||||
}
|
||||
catch (IllegalArgumentException expected) {
|
||||
|
||||
assertThat(expected).hasMessage(
|
||||
"Environment [%s] was not configurable or does not contain an enumerable [vcap] PropertySource",
|
||||
mockEnvironment);
|
||||
assertThat(expected)
|
||||
.hasMessage("Environment was not configurable or does not contain an enumerable [vcap] PropertySource");
|
||||
|
||||
assertThat(expected).hasNoCause();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user