From d0013ffce593470711bcf178229acc89e8af681e Mon Sep 17 00:00:00 2001 From: John Blum Date: Mon, 28 May 2018 15:44:18 -0700 Subject: [PATCH] Fix String formatted Exception message logging the Environment state in from(:Environment). --- .../boot/data/geode/core/env/VcapPropertySource.java | 4 ++-- .../geode/core/env/VcapPropertySourceUnitTests.java | 10 ++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/geode-spring-boot-starter/src/main/java/org/springframework/boot/data/geode/core/env/VcapPropertySource.java b/geode-spring-boot-starter/src/main/java/org/springframework/boot/data/geode/core/env/VcapPropertySource.java index 3b7b77f4..1466db95 100644 --- a/geode-spring-boot-starter/src/main/java/org/springframework/boot/data/geode/core/env/VcapPropertySource.java +++ b/geode-spring-boot-starter/src/main/java/org/springframework/boot/data/geode/core/env/VcapPropertySource.java @@ -98,8 +98,8 @@ public class VcapPropertySource extends PropertySource 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) { diff --git a/geode-spring-boot-starter/src/test/java/org/springframework/boot/data/geode/core/env/VcapPropertySourceUnitTests.java b/geode-spring-boot-starter/src/test/java/org/springframework/boot/data/geode/core/env/VcapPropertySourceUnitTests.java index b6a162d4..1dd6e3af 100644 --- a/geode-spring-boot-starter/src/test/java/org/springframework/boot/data/geode/core/env/VcapPropertySourceUnitTests.java +++ b/geode-spring-boot-starter/src/test/java/org/springframework/boot/data/geode/core/env/VcapPropertySourceUnitTests.java @@ -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();