Merge branch '3.0.x'

This commit is contained in:
spencergibb
2021-12-10 11:46:26 -05:00
2 changed files with 9 additions and 1 deletions

View File

@@ -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();
}

View File

@@ -344,4 +344,12 @@ 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/");
}
}