Include empty layers when listing and extracting

Fixes gh-21301
This commit is contained in:
Andy Wilkinson
2020-05-04 15:15:14 +01:00
parent 5d7df790f1
commit de1e3c6069
4 changed files with 12 additions and 9 deletions

View File

@@ -69,10 +69,11 @@ class ExtractCommandTests {
@Test
void runExtractsLayers() throws Exception {
this.command.run(Collections.emptyMap(), Collections.emptyList());
assertThat(this.extract.list()).containsOnly("a", "b", "c");
assertThat(this.extract.list()).containsOnly("a", "b", "c", "d");
assertThat(new File(this.extract, "a/a/a.jar")).exists();
assertThat(new File(this.extract, "b/b/b.jar")).exists();
assertThat(new File(this.extract, "c/c/c.jar")).exists();
assertThat(new File(this.extract, "d")).isDirectory();
}
@Test
@@ -119,7 +120,7 @@ class ExtractCommandTests {
@Override
public Iterator<String> iterator() {
return Arrays.asList("a", "b", "c").iterator();
return Arrays.asList("a", "b", "c", "d").iterator();
}
@Override

View File

@@ -52,7 +52,7 @@ class IndexedLayersTests {
@Test
void iteratorReturnsLayers() throws Exception {
IndexedLayers layers = new IndexedLayers(getIndex());
assertThat(layers).containsExactly("test", "application");
assertThat(layers).containsExactly("test", "empty", "application");
}
@Test

View File

@@ -1,6 +1,7 @@
- "test":
- "BOOT-INF/lib/a.jar"
- "BOOT-INF/lib/b.jar"
- "empty":
- "application":
- "BOOT-INF/classes/Demo.class"
- "META-INF/"