Merge branch '2.1.x'
Closes gh-17335 Closes gh-17292
This commit is contained in:
@@ -350,12 +350,14 @@ class InitCommandTests extends AbstractHttpClientMockTests {
|
||||
}
|
||||
|
||||
private byte[] createFakeZipArchive(String fileName, String content) throws IOException {
|
||||
try (ByteArrayOutputStream bos = new ByteArrayOutputStream(); ZipOutputStream zos = new ZipOutputStream(bos)) {
|
||||
ZipEntry entry = new ZipEntry(fileName);
|
||||
zos.putNextEntry(entry);
|
||||
zos.write(content.getBytes());
|
||||
zos.closeEntry();
|
||||
return bos.toByteArray();
|
||||
try (ByteArrayOutputStream bos = new ByteArrayOutputStream()) {
|
||||
try (ZipOutputStream zos = new ZipOutputStream(bos)) {
|
||||
ZipEntry entry = new ZipEntry(fileName);
|
||||
zos.putNextEntry(entry);
|
||||
zos.write(content.getBytes());
|
||||
zos.closeEntry();
|
||||
return bos.toByteArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user