From 68d875bdc642856e2c47d67183bdf6a05cfc4895 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Tue, 14 Jul 2015 21:39:54 +0200 Subject: [PATCH] Fix windows build --- .../configurationmetadata/DescriptionExtractor.java | 4 ++-- .../DescriptionExtractorTests.java | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/spring-boot-tools/spring-boot-configuration-metadata/src/main/java/org/springframework/boot/configurationmetadata/DescriptionExtractor.java b/spring-boot-tools/spring-boot-configuration-metadata/src/main/java/org/springframework/boot/configurationmetadata/DescriptionExtractor.java index d59745ce38..d4d346d596 100644 --- a/spring-boot-tools/spring-boot-configuration-metadata/src/main/java/org/springframework/boot/configurationmetadata/DescriptionExtractor.java +++ b/spring-boot-tools/spring-boot-configuration-metadata/src/main/java/org/springframework/boot/configurationmetadata/DescriptionExtractor.java @@ -20,13 +20,13 @@ import java.text.BreakIterator; import java.util.Locale; /** - * Utility to extract a descriptions. + * Utility to extract a description. * * @author Stephane Nicoll */ class DescriptionExtractor { - private static final String NEW_LINE = System.getProperty("line.separator"); + static final String NEW_LINE = System.getProperty("line.separator"); public String getShortDescription(String description) { if (description == null) { diff --git a/spring-boot-tools/spring-boot-configuration-metadata/src/test/java/org/springframework/boot/configurationmetadata/DescriptionExtractorTests.java b/spring-boot-tools/spring-boot-configuration-metadata/src/test/java/org/springframework/boot/configurationmetadata/DescriptionExtractorTests.java index ab5e698398..37f2971421 100644 --- a/spring-boot-tools/spring-boot-configuration-metadata/src/test/java/org/springframework/boot/configurationmetadata/DescriptionExtractorTests.java +++ b/spring-boot-tools/spring-boot-configuration-metadata/src/test/java/org/springframework/boot/configurationmetadata/DescriptionExtractorTests.java @@ -38,14 +38,17 @@ public class DescriptionExtractorTests { @Test public void extractShortDescriptionNewLineBeforeDot() { assertEquals("My short description.", - this.extractor.getShortDescription("My short\ndescription.\nMore stuff.")); + this.extractor.getShortDescription("My short" + DescriptionExtractor.NEW_LINE + + "description." + DescriptionExtractor.NEW_LINE + "More stuff.")); } @Test public void extractShortDescriptionNewLineBeforeDotWithSpaces() { assertEquals("My short description.", this.extractor - .getShortDescription("My short \n description. \nMore stuff.")); + .getShortDescription("My short " + + DescriptionExtractor.NEW_LINE + " description. " + + DescriptionExtractor.NEW_LINE + "More stuff.")); } @Test @@ -57,7 +60,8 @@ public class DescriptionExtractorTests { @Test public void extractShortDescriptionNoDotMultipleLines() { assertEquals("My short description", - this.extractor.getShortDescription("My short description \n More stuff")); + this.extractor.getShortDescription("My short description " + + DescriptionExtractor.NEW_LINE + " More stuff")); } @Test