Skip to content
Snippets Groups Projects
Commit a0ded685 authored by OZGCloud's avatar OZGCloud
Browse files

Merge pull request 'OZG-4479: ZIP File lässt sich nicht öffnen' (#238) from...

Merge pull request 'OZG-4479: ZIP File lässt sich nicht öffnen' (#238) from OZG-4479-ZIP-file-laesst-sich-nicht-oeffnen into master

Reviewed-on: https://git.ozg-sh.de/ozgcloud-app/vorgang-manager/pulls/238


Reviewed-by: default avatarOZGCloud <ozgcloud@mgm-tp.com>
parents 64b76695 ad3ce7b5
Branches
Tags
No related merge requests found
......@@ -101,7 +101,7 @@ class ZipBuilderService {
}
private String folderByContentType(String contentType) {
return StringUtils.equals(contentType, MimeTypeUtils.APPLICATION_XML_VALUE) ? FOLDER_NAME_XML : "/";
return StringUtils.equals(contentType, MimeTypeUtils.APPLICATION_XML_VALUE) ? FOLDER_NAME_XML : "";
}
private void addAttachments() {
......@@ -113,7 +113,7 @@ class ZipBuilderService {
}
void addFile(String folder, IncomingFile file) {
var fileName = String.format(FILE_NAME_TEMPLATE, folder, file.getName());
var fileName = StringUtils.isEmpty(folder) ? file.getName() : String.format(FILE_NAME_TEMPLATE, folder, file.getName());
try {
zipOut.putNextEntry(buildZipParameter(fileName));
......
......@@ -43,7 +43,6 @@ import de.ozgcloud.vorgang.common.security.PolicyService;
import de.ozgcloud.vorgang.grpc.clientAttribute.ClientAttributeServiceGrpc.ClientAttributeServiceBlockingStub;
import net.devh.boot.grpc.client.inject.GrpcClient;
@Disabled
@SpringBootTest(properties = {
"grpc.server.inProcessName=test",
"grpc.server.port=-1",
......
......@@ -89,7 +89,7 @@ class ZipBuilderServiceTest {
builder.addFile("", IncomingFileTestFactory.create());
verify(zipOut).putNextEntry(parametersCaptor.capture());
assertThat(parametersCaptor.getValue().getFileNameInZip()).isEqualTo("/" + IncomingFileTestFactory.NAME);
assertThat(parametersCaptor.getValue().getFileNameInZip()).isEqualTo(IncomingFileTestFactory.NAME);
}
@Test
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment