Test layer index can contain filenames with spaces
Add tests to ensure that the layer index can support filenames that contain spaces. Closes gh-20827
This commit is contained in:
@@ -76,6 +76,12 @@ class IndexedLayersTests {
|
||||
assertThat(layers.getLayer(mockEntry("META-INF/a/sub/folder/and/a/file"))).isEqualTo("application");
|
||||
}
|
||||
|
||||
@Test
|
||||
void getLayerWhenFileHasSpaceReturnsLayer() throws Exception {
|
||||
IndexedLayers layers = new IndexedLayers(getIndex());
|
||||
assertThat(layers.getLayer(mockEntry("a b/c d"))).isEqualTo("application");
|
||||
}
|
||||
|
||||
private String getIndex() throws Exception {
|
||||
ClassPathResource resource = new ClassPathResource("test-layers.idx", getClass());
|
||||
InputStreamReader reader = new InputStreamReader(resource.getInputStream());
|
||||
|
||||
@@ -4,3 +4,4 @@
|
||||
- "application":
|
||||
- "BOOT-INF/classes/Demo.class"
|
||||
- "META-INF/"
|
||||
- "a b/c d"
|
||||
|
||||
Reference in New Issue
Block a user