Skip to content
Snippets Groups Projects
Commit 8dee9a82 authored by Martin Vogel's avatar Martin Vogel
Browse files

fix(#566): fix integration test

parent 2ce6d2f5
No related branches found
No related tags found
1 merge request!7Validierung des Metadaten Schemas
This commit is part of merge request !7. Comments created here will be created in the context of that merge request.
...@@ -241,15 +241,15 @@ public class SenderClient { ...@@ -241,15 +241,15 @@ public class SenderClient {
/** Set encrypted metadata with data payload and attachments **/ /** Set encrypted metadata with data payload and attachments **/
logger.info("Adding data payload with mime-type {} to submission", this.dataPayload.mimeType); logger.info("Adding data payload with mime-type {} to submission", this.dataPayload.mimeType);
final DataPayload data = getEncryptedData(this.dataPayload, destination, encryptionKey); final DataPayload dataToSend = getEncryptedData(this.dataPayload, destination, encryptionKey);
final Metadata metadata = createMetadata(hashedAttachments, dataPayload); final Metadata metadata = createMetadata(hashedAttachments, dataToSend);
final ValidationResult validatedMetadata = sender.validateMetadata(metadata, metadataSchema); final ValidationResult validatedMetadata = sender.validateMetadata(metadata, metadataSchema);
if (validatedMetadata.hasError()) { if (validatedMetadata.hasError()) {
logger.error("Metadata does not match schema", validatedMetadata.getError()); logger.error("Metadata does not match schema", validatedMetadata.getError());
sender.rejectSubmission(submissionId, destinationId, announcedSubmission.getCaseId()); sender.rejectSubmission(submissionId, destinationId, announcedSubmission.getCaseId());
return Optional.empty(); return Optional.empty();
} }
submission.setEncryptedData(data.getEncryptedData()); submission.setEncryptedData(dataToSend.getEncryptedData());
submission.setEncryptedMetadata(sender.encryptObject(encryptionKey, metadata)); submission.setEncryptedMetadata(sender.encryptObject(encryptionKey, metadata));
/** submit submission **/ /** submit submission **/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment