From ff2a603f2fde6833029af231fb7c5ca397a97211 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Wed, 1 Jun 2011 15:04:34 +0000 Subject: [PATCH] [SPR-7960] Trimming profiles for good measure. --- .../org/springframework/test/context/ContextLoaderUtils.java | 2 +- .../springframework/test/context/ContextLoaderUtilsTests.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/org.springframework.test/src/main/java/org/springframework/test/context/ContextLoaderUtils.java b/org.springframework.test/src/main/java/org/springframework/test/context/ContextLoaderUtils.java index 18c9fd4c64..1309d30012 100644 --- a/org.springframework.test/src/main/java/org/springframework/test/context/ContextLoaderUtils.java +++ b/org.springframework.test/src/main/java/org/springframework/test/context/ContextLoaderUtils.java @@ -270,7 +270,7 @@ abstract class ContextLoaderUtils { for (String profile : profiles) { if (StringUtils.hasText(profile)) { - activeProfiles.add(profile); + activeProfiles.add(profile.trim()); } } diff --git a/org.springframework.test/src/test/java/org/springframework/test/context/ContextLoaderUtilsTests.java b/org.springframework.test/src/test/java/org/springframework/test/context/ContextLoaderUtilsTests.java index 22d8433d9e..60012d3f9f 100644 --- a/org.springframework.test/src/test/java/org/springframework/test/context/ContextLoaderUtilsTests.java +++ b/org.springframework.test/src/test/java/org/springframework/test/context/ContextLoaderUtilsTests.java @@ -116,7 +116,7 @@ public class ContextLoaderUtilsTests { private static class EmptyProfiles { } - @ActiveProfiles({ "foo", "bar", "foo", "bar", "baz" }) + @ActiveProfiles({ "foo", "bar", " foo", "bar ", "baz" }) private static class DuplicatedProfiles { }