Fixed #1499, append slash to search-locations ending when it is missed.
This commit is contained in:
@@ -97,7 +97,7 @@ public class NativeEnvironmentRepository implements EnvironmentRepository, Searc
|
||||
this.defaultLabel = properties.getDefaultLabel();
|
||||
this.failOnError = properties.getFailOnError();
|
||||
this.order = properties.getOrder();
|
||||
this.searchLocations = properties.getSearchLocations();
|
||||
setSearchLocations(properties.getSearchLocations());
|
||||
this.version = properties.getVersion();
|
||||
}
|
||||
|
||||
|
||||
@@ -344,4 +344,11 @@ public class ResourceControllerTests {
|
||||
assertThat(resource).isEqualToIgnoringNewLines("foo: dev_bar/spam");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void setSearchLocationsAppendSlashByConstructor() {
|
||||
final NativeEnvironmentProperties properties = new NativeEnvironmentProperties();
|
||||
properties.setSearchLocations(new String[]{"classpath:/test"});
|
||||
NativeEnvironmentRepository repo = new NativeEnvironmentRepository(this.context.getEnvironment(), properties);
|
||||
assertThat(repo.getSearchLocations()[0]).isEqualTo("classpath:/test/");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user