diff --git a/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/resource/GenericResourceRepository.java b/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/resource/GenericResourceRepository.java index e354554b..47c035ad 100644 --- a/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/resource/GenericResourceRepository.java +++ b/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/resource/GenericResourceRepository.java @@ -64,7 +64,7 @@ public class GenericResourceRepository String[] locations = this.service.getLocations(application, profile, label) .getLocations(); try { - for (int i = locations.length; i-- > 0; ) { + for (int i = locations.length; i-- > 0;) { String location = locations[i]; for (String local : getProfilePaths(profile, path)) { if (!isInvalidPath(local) && !isInvalidEncodedPath(local)) { @@ -116,7 +116,8 @@ public class GenericResourceRepository private boolean isInvalidEncodedPath(String path) { if (path.contains("%")) { try { - // Use URLDecoder (vs UriUtils) to preserve potentially decoded UTF-8 chars + // Use URLDecoder (vs UriUtils) to preserve potentially decoded UTF-8 + // chars String decodedPath = URLDecoder.decode(path, "UTF-8"); if (isInvalidPath(decodedPath)) { return true; @@ -135,13 +136,13 @@ public class GenericResourceRepository /** * Process the given resource path. - *
The default implementation replaces: + *
+ * The default implementation replaces: *
Note: this method assumes that leading, duplicate '/' - * or control characters (e.g. white space) have been trimmed so that the - * path starts predictably with a single '/' or does not have one. + *
+ * Note: this method assumes that leading, duplicate '/' or control + * characters (e.g. white space) have been trimmed so that the path starts predictably + * with a single '/' or does not have one. * @param path the path to validate * @return {@code true} if the path is invalid, {@code false} otherwise * @since 3.0.6 @@ -220,17 +219,20 @@ public class GenericResourceRepository String relativePath = (path.charAt(0) == '/' ? path.substring(1) : path); if (ResourceUtils.isUrl(relativePath) || relativePath.startsWith("url:")) { if (logger.isWarnEnabled()) { - logger.warn("Path represents URL or has \"url:\" prefix: [" + path + "]"); + logger.warn( + "Path represents URL or has \"url:\" prefix: [" + path + "]"); } return true; } } if (path.contains("..") && StringUtils.cleanPath(path).contains("../")) { if (logger.isWarnEnabled()) { - logger.warn("Path contains \"../\" after call to StringUtils#cleanPath: [" + path + "]"); + logger.warn("Path contains \"../\" after call to StringUtils#cleanPath: [" + + path + "]"); } return true; } return false; } + } diff --git a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/BootstrapConfigServerIntegrationTests.java b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/BootstrapConfigServerIntegrationTests.java index fc8d7328..dc396952 100644 --- a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/BootstrapConfigServerIntegrationTests.java +++ b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/BootstrapConfigServerIntegrationTests.java @@ -18,6 +18,8 @@ package org.springframework.cloud.config.server; import java.io.IOException; +import org.eclipse.jgit.junit.MockSystemReader; +import org.eclipse.jgit.util.SystemReader; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; @@ -51,6 +53,9 @@ public class BootstrapConfigServerIntegrationTests { @BeforeClass public static void init() throws IOException { + // mock Git configuration to make tests independent of local Git configuration + SystemReader.setInstance(new MockSystemReader()); + ConfigServerTestUtils.prepareLocalRepo("encrypt-repo"); } diff --git a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/CompositeIntegrationTests.java b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/CompositeIntegrationTests.java index 5c25167f..9ead658b 100644 --- a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/CompositeIntegrationTests.java +++ b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/CompositeIntegrationTests.java @@ -16,6 +16,8 @@ package org.springframework.cloud.config.server; +import org.eclipse.jgit.junit.MockSystemReader; +import org.eclipse.jgit.util.SystemReader; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; @@ -52,6 +54,9 @@ public class CompositeIntegrationTests { @BeforeClass public static void init() throws Exception { + // mock Git configuration to make tests independent of local Git configuration + SystemReader.setInstance(new MockSystemReader()); + ConfigServerTestUtils.prepareLocalRepo(); ConfigServerTestUtils.prepareLocalSvnRepo( "src/test/resources/svn-config-repo", "target/repos/svn-config-repo"); @@ -110,6 +115,9 @@ public class CompositeIntegrationTests { @BeforeClass public static void init() throws Exception { + // mock Git configuration to make tests independent of local Git configuration + SystemReader.setInstance(new MockSystemReader()); + ConfigServerTestUtils.prepareLocalRepo(); ConfigServerTestUtils.prepareLocalSvnRepo( "src/test/resources/svn-config-repo", "target/repos/svn-config-repo"); diff --git a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/ConfigClientOffIntegrationTests.java b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/ConfigClientOffIntegrationTests.java index f52410d7..9a506b60 100644 --- a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/ConfigClientOffIntegrationTests.java +++ b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/ConfigClientOffIntegrationTests.java @@ -18,6 +18,8 @@ package org.springframework.cloud.config.server; import java.io.IOException; +import org.eclipse.jgit.junit.MockSystemReader; +import org.eclipse.jgit.util.SystemReader; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; @@ -60,6 +62,9 @@ public class ConfigClientOffIntegrationTests { @BeforeClass public static void init() throws IOException { + // mock Git configuration to make tests independent of local Git configuration + SystemReader.setInstance(new MockSystemReader()); + ConfigServerTestUtils.prepareLocalRepo(); } diff --git a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/ConfigClientOnIntegrationTests.java b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/ConfigClientOnIntegrationTests.java index 5f070b17..32de5240 100644 --- a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/ConfigClientOnIntegrationTests.java +++ b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/ConfigClientOnIntegrationTests.java @@ -18,6 +18,8 @@ package org.springframework.cloud.config.server; import java.io.IOException; +import org.eclipse.jgit.junit.MockSystemReader; +import org.eclipse.jgit.util.SystemReader; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; @@ -65,6 +67,9 @@ public class ConfigClientOnIntegrationTests { @BeforeClass public static void init() throws IOException { + // mock Git configuration to make tests independent of local Git configuration + SystemReader.setInstance(new MockSystemReader()); + localRepo = ConfigServerTestUtils.prepareLocalRepo(); } diff --git a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/NativeConfigServerIntegrationTests.java b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/NativeConfigServerIntegrationTests.java index 89cb1a4e..4f3b3fba 100644 --- a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/NativeConfigServerIntegrationTests.java +++ b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/NativeConfigServerIntegrationTests.java @@ -18,6 +18,8 @@ package org.springframework.cloud.config.server; import java.io.IOException; +import org.eclipse.jgit.junit.MockSystemReader; +import org.eclipse.jgit.util.SystemReader; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; @@ -46,6 +48,9 @@ public class NativeConfigServerIntegrationTests { @BeforeClass public static void init() throws IOException { + // mock Git configuration to make tests independent of local Git configuration + SystemReader.setInstance(new MockSystemReader()); + ConfigServerTestUtils.prepareLocalRepo(); } diff --git a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/VanillaConfigServerIntegrationTests.java b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/VanillaConfigServerIntegrationTests.java index 96fc4294..81331d57 100644 --- a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/VanillaConfigServerIntegrationTests.java +++ b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/VanillaConfigServerIntegrationTests.java @@ -19,6 +19,8 @@ package org.springframework.cloud.config.server; import java.io.IOException; import java.util.Arrays; +import org.eclipse.jgit.junit.MockSystemReader; +import org.eclipse.jgit.util.SystemReader; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; @@ -51,6 +53,9 @@ public class VanillaConfigServerIntegrationTests { @BeforeClass public static void init() throws IOException { + // mock Git configuration to make tests independent of local Git configuration + SystemReader.setInstance(new MockSystemReader()); + ConfigServerTestUtils.prepareLocalRepo(); } diff --git a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/config/CustomCompositeEnvironmentRepositoryTests.java b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/config/CustomCompositeEnvironmentRepositoryTests.java index 71d821b4..67ac0d12 100644 --- a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/config/CustomCompositeEnvironmentRepositoryTests.java +++ b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/config/CustomCompositeEnvironmentRepositoryTests.java @@ -19,6 +19,8 @@ package org.springframework.cloud.config.server.config; import java.util.HashMap; import java.util.List; +import org.eclipse.jgit.junit.MockSystemReader; +import org.eclipse.jgit.util.SystemReader; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; @@ -64,6 +66,9 @@ public class CustomCompositeEnvironmentRepositoryTests { @BeforeClass public static void init() throws Exception { + // mock Git configuration to make tests independent of local Git configuration + SystemReader.setInstance(new MockSystemReader()); + ConfigServerTestUtils.prepareLocalRepo(); } @@ -115,6 +120,9 @@ public class CustomCompositeEnvironmentRepositoryTests { @BeforeClass public static void init() throws Exception { + // mock Git configuration to make tests independent of local Git configuration + SystemReader.setInstance(new MockSystemReader()); + ConfigServerTestUtils.prepareLocalRepo(); } diff --git a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/environment/JGitEnvironmentRepositoryConcurrencyTests.java b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/environment/JGitEnvironmentRepositoryConcurrencyTests.java index bfd83375..6635d5c7 100644 --- a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/environment/JGitEnvironmentRepositoryConcurrencyTests.java +++ b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/environment/JGitEnvironmentRepositoryConcurrencyTests.java @@ -38,12 +38,15 @@ import org.eclipse.jgit.api.errors.InvalidRemoteException; import org.eclipse.jgit.api.errors.RefAlreadyExistsException; import org.eclipse.jgit.api.errors.RefNotFoundException; import org.eclipse.jgit.api.errors.TransportException; +import org.eclipse.jgit.junit.MockSystemReader; import org.eclipse.jgit.lib.Ref; import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.transport.FetchResult; import org.eclipse.jgit.util.FileUtils; +import org.eclipse.jgit.util.SystemReader; import org.junit.After; import org.junit.Before; +import org.junit.BeforeClass; import org.junit.Test; import org.springframework.boot.WebApplicationType; @@ -72,6 +75,12 @@ public class JGitEnvironmentRepositoryConcurrencyTests { private File basedir = new File("target/config"); + @BeforeClass + public static void initClass() { + // mock Git configuration to make tests independent of local Git configuration + SystemReader.setInstance(new MockSystemReader()); + } + @Before public void init() throws Exception { if (this.basedir.exists()) { diff --git a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/environment/JGitEnvironmentRepositoryIntegrationTests.java b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/environment/JGitEnvironmentRepositoryIntegrationTests.java index 2764f96d..22371f81 100644 --- a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/environment/JGitEnvironmentRepositoryIntegrationTests.java +++ b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/environment/JGitEnvironmentRepositoryIntegrationTests.java @@ -33,12 +33,15 @@ import org.eclipse.jgit.api.Git; import org.eclipse.jgit.api.ResetCommand.ResetType; import org.eclipse.jgit.api.TransportConfigCallback; import org.eclipse.jgit.api.errors.GitAPIException; +import org.eclipse.jgit.junit.MockSystemReader; import org.eclipse.jgit.lib.Ref; import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.lib.StoredConfig; import org.eclipse.jgit.util.FileUtils; +import org.eclipse.jgit.util.SystemReader; import org.junit.After; import org.junit.Before; +import org.junit.BeforeClass; import org.junit.Test; import org.mockito.Mockito; @@ -72,6 +75,12 @@ public class JGitEnvironmentRepositoryIntegrationTests { private File basedir = new File("target/config"); + @BeforeClass + public static void initClass() { + // mock Git configuration to make tests independent of local Git configuration + SystemReader.setInstance(new MockSystemReader()); + } + @Before public void init() throws Exception { if (this.basedir.exists()) { diff --git a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/environment/JGitEnvironmentRepositoryTests.java b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/environment/JGitEnvironmentRepositoryTests.java index 0c61bb85..1c0542f4 100644 --- a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/environment/JGitEnvironmentRepositoryTests.java +++ b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/environment/JGitEnvironmentRepositoryTests.java @@ -42,6 +42,7 @@ import org.eclipse.jgit.api.errors.InvalidRemoteException; import org.eclipse.jgit.api.errors.NotMergedException; import org.eclipse.jgit.api.errors.TransportException; import org.eclipse.jgit.attributes.AttributesNodeProvider; +import org.eclipse.jgit.junit.MockSystemReader; import org.eclipse.jgit.lib.BaseRepositoryBuilder; import org.eclipse.jgit.lib.ObjectDatabase; import org.eclipse.jgit.lib.ObjectId; @@ -58,7 +59,9 @@ import org.eclipse.jgit.transport.TrackingRefUpdate; import org.eclipse.jgit.transport.URIish; import org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider; import org.eclipse.jgit.util.FileUtils; +import org.eclipse.jgit.util.SystemReader; import org.junit.Before; +import org.junit.BeforeClass; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; @@ -100,6 +103,12 @@ public class JGitEnvironmentRepositoryTests { private File basedir = new File("target/config"); + @BeforeClass + public static void initClass() { + // mock Git configuration to make tests independent of local Git configuration + SystemReader.setInstance(new MockSystemReader()); + } + @Before public void init() throws Exception { String uri = ConfigServerTestUtils.prepareLocalRepo(); diff --git a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/environment/MultipleJGitEnvironmentApplicationPlaceholderRepositoryTests.java b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/environment/MultipleJGitEnvironmentApplicationPlaceholderRepositoryTests.java index e0ef0895..a46303c1 100644 --- a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/environment/MultipleJGitEnvironmentApplicationPlaceholderRepositoryTests.java +++ b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/environment/MultipleJGitEnvironmentApplicationPlaceholderRepositoryTests.java @@ -19,7 +19,10 @@ package org.springframework.cloud.config.server.environment; import java.util.HashMap; import java.util.Map; +import org.eclipse.jgit.junit.MockSystemReader; +import org.eclipse.jgit.util.SystemReader; import org.junit.Before; +import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.Test; @@ -42,6 +45,12 @@ public class MultipleJGitEnvironmentApplicationPlaceholderRepositoryTests { private MultipleJGitEnvironmentRepository repository = new MultipleJGitEnvironmentRepository( this.environment, new MultipleJGitEnvironmentProperties()); + @BeforeClass + public static void initClass() { + // mock Git configuration to make tests independent of local Git configuration + SystemReader.setInstance(new MockSystemReader()); + } + @Before public void init() throws Exception { String defaultUri = ConfigServerTestUtils.prepareLocalRepo("config-repo"); diff --git a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/environment/MultipleJGitEnvironmentLabelPlaceholderRepositoryTests.java b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/environment/MultipleJGitEnvironmentLabelPlaceholderRepositoryTests.java index 13618f89..03d48776 100644 --- a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/environment/MultipleJGitEnvironmentLabelPlaceholderRepositoryTests.java +++ b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/environment/MultipleJGitEnvironmentLabelPlaceholderRepositoryTests.java @@ -16,7 +16,10 @@ package org.springframework.cloud.config.server.environment; +import org.eclipse.jgit.junit.MockSystemReader; +import org.eclipse.jgit.util.SystemReader; import org.junit.Before; +import org.junit.BeforeClass; import org.junit.Test; import org.springframework.cloud.config.environment.Environment; @@ -39,6 +42,12 @@ public class MultipleJGitEnvironmentLabelPlaceholderRepositoryTests { private String defaultUri; + @BeforeClass + public static void initClass() { + // mock Git configuration to make tests independent of local Git configuration + SystemReader.setInstance(new MockSystemReader()); + } + @Before public void init() throws Exception { this.defaultUri = ConfigServerTestUtils diff --git a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/environment/MultipleJGitEnvironmentProfilePlaceholderRepositoryTests.java b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/environment/MultipleJGitEnvironmentProfilePlaceholderRepositoryTests.java index 9f0cbca3..b5777c88 100644 --- a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/environment/MultipleJGitEnvironmentProfilePlaceholderRepositoryTests.java +++ b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/environment/MultipleJGitEnvironmentProfilePlaceholderRepositoryTests.java @@ -20,7 +20,10 @@ import java.io.File; import java.util.HashMap; import java.util.Map; +import org.eclipse.jgit.junit.MockSystemReader; +import org.eclipse.jgit.util.SystemReader; import org.junit.Before; +import org.junit.BeforeClass; import org.junit.Test; import org.springframework.cloud.config.environment.Environment; @@ -44,6 +47,12 @@ public class MultipleJGitEnvironmentProfilePlaceholderRepositoryTests { private MultipleJGitEnvironmentRepository repository = new MultipleJGitEnvironmentRepository( this.environment, new MultipleJGitEnvironmentProperties()); + @BeforeClass + public static void initClass() { + // mock Git configuration to make tests independent of local Git configuration + SystemReader.setInstance(new MockSystemReader()); + } + @Before public void init() throws Exception { String defaultUri = ConfigServerTestUtils.prepareLocalRepo("config-repo"); diff --git a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/environment/MultipleJGitEnvironmentRepositoryIntegrationTests.java b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/environment/MultipleJGitEnvironmentRepositoryIntegrationTests.java index fb70c168..1cf8fc96 100644 --- a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/environment/MultipleJGitEnvironmentRepositoryIntegrationTests.java +++ b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/environment/MultipleJGitEnvironmentRepositoryIntegrationTests.java @@ -22,9 +22,12 @@ import java.util.LinkedHashMap; import java.util.Map; import org.assertj.core.api.Assertions; +import org.eclipse.jgit.junit.MockSystemReader; import org.eclipse.jgit.util.FileUtils; +import org.eclipse.jgit.util.SystemReader; import org.junit.After; import org.junit.Before; +import org.junit.BeforeClass; import org.junit.Rule; import org.junit.Test; import org.junit.internal.matchers.ThrowableMessageMatcher; @@ -59,6 +62,12 @@ public class MultipleJGitEnvironmentRepositoryIntegrationTests { private File basedir = new File("target/config"); + @BeforeClass + public static void initClass() { + // mock Git configuration to make tests independent of local Git configuration + SystemReader.setInstance(new MockSystemReader()); + } + @Before public void init() throws Exception { if (this.basedir.exists()) { diff --git a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/environment/MultipleJGitEnvironmentRepositoryTests.java b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/environment/MultipleJGitEnvironmentRepositoryTests.java index a586720f..3f346b13 100644 --- a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/environment/MultipleJGitEnvironmentRepositoryTests.java +++ b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/environment/MultipleJGitEnvironmentRepositoryTests.java @@ -24,7 +24,10 @@ import java.util.HashMap; import java.util.Map; import org.eclipse.jgit.api.TransportConfigCallback; +import org.eclipse.jgit.junit.MockSystemReader; +import org.eclipse.jgit.util.SystemReader; import org.junit.Before; +import org.junit.BeforeClass; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; @@ -54,6 +57,12 @@ public class MultipleJGitEnvironmentRepositoryTests { private MultipleJGitEnvironmentRepository repository; + @BeforeClass + public static void initClass() { + // mock Git configuration to make tests independent of local Git configuration + SystemReader.setInstance(new MockSystemReader()); + } + @Before public void init() throws Exception { String defaultUri = ConfigServerTestUtils.prepareLocalRepo("config-repo"); diff --git a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/resource/GenericResourceRepositoryTests.java b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/resource/GenericResourceRepositoryTests.java index 51c4b0f8..a5594882 100644 --- a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/resource/GenericResourceRepositoryTests.java +++ b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/resource/GenericResourceRepositoryTests.java @@ -98,9 +98,11 @@ public class GenericResourceRepositoryTests { @Test public void invalidPath() { this.exception.expect(NoSuchResourceException.class); - this.nativeRepository.setSearchLocations("file:./src/test/resources/test/{profile}"); + this.nativeRepository + .setSearchLocations("file:./src/test/resources/test/{profile}"); this.repository.findOne("blah", "local", "master", "..%2F..%2Fdata-jdbc.sql"); - this.output.expect(containsString("Path contains \"../\" after call to StringUtils#cleanPath")); + this.output.expect(containsString( + "Path contains \"../\" after call to StringUtils#cleanPath")); } }