-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* implement checksum verification * seperate locationUrl retrieval from upload method * refactor getbloburi and gethash into UploadAttachment * format document * remove unused methods * Check if rows updated are 1, otherwise return false * Create static class containing text used in AttachmentStatus to provide more information * Add checksum to factories * fix: check if checksum is empty before comparison * fix missing data in attachment overview * add missing expiration date * add missing data * remove duplicate from other pr * First tests written * cleanup all attachmentData * fix attachmentFactory in test * fix ExternalReferences * Add checksum to GetAttachmentOverviewResponse and AttachmentOverviewMapper * support null values for list in correspondence requests * send correspondenceAttachment id on get operations for attachment * More tests * Implement changes to UploadHelper * fix: use AttachmentId instead of AttachmentEntity * fix possible memory leak * add more errors * add data to error message for testing purposes * compare expectedChanges with actual rows updated for debugging * update current testing process * add fix for multiple correspondences * cleanup * fix create correspondence operations * change to upload faile * more cleanup * fix wrong bool check for rows updated --------- Co-authored-by: Hammerbeck <andreas.hammerbeck@digdir.no> Co-authored-by: Andreas Hammerbeck <Andreas_93@hotmail.com>
- Loading branch information
1 parent
6ff626f
commit 530c8b3
Showing
22 changed files
with
299 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
namespace Altinn.Correspondence.Tests.Helpers | ||
{ | ||
internal static class Utils | ||
{ | ||
public static string CalculateChecksum(byte[] data) | ||
{ | ||
using (var md5 = System.Security.Cryptography.MD5.Create()) | ||
{ | ||
byte[] hash = md5.ComputeHash(data); | ||
return BitConverter.ToString(hash).Replace("-", "").ToLower(); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
src/Altinn.Correspondence.Application/AttachmentStatusText.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace Altinn.Correspondence.Application | ||
{ | ||
public static class AttachmentStatusText | ||
{ | ||
public const string InvalidLocationUrl = "Could not get data location url"; | ||
public const string ChecksumMismatch = "Checksum mismatch"; | ||
public const string UploadFailed = "Upload failed"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.