Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/AL-Go-Settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"repoVersion": "30.0",
"memoryLimit": "16G",
"numberOfTenantsForTesting": 4,
"enableCleanTestCodeunitExecution": true,
"maxTestAppReruns": 2,
"failOn": "newWarning",
"workspaceCompilation": {
Expand Down
1 change: 1 addition & 0 deletions src/Apps/US/IRSForms/test/src/IRS1099APITests.Codeunit.al
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ codeunit 148018 "IRS 1099 API Tests"
IRS1099FormDocHeader: Record "IRS 1099 Form Doc. Header";
IRSReportingPeriod: Record "IRS Reporting Period";
begin
LibraryGraphMgt.SetLicenseSafeWorkDate();
IRS1099FormDocHeader.DeleteAll(true);
IRSReportingPeriod.DeleteAll(true);
LibraryTestInitialize.OnTestInitialize(Codeunit::"IRS 1099 API Tests");
Expand Down
2 changes: 2 additions & 0 deletions src/Apps/W1/APIV1/test/src/APIV1AccountsE2E.Codeunit.al
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ codeunit 139701 "APIV1 - Accounts E2E"

Subtype = Test;
TestHttpRequestPolicy = AllowAllOutboundRequests;
RequiredTestIsolation = Disabled;
Comment thread
t-prda marked this conversation as resolved.
TestPermissions = Disabled;

trigger OnRun()
Expand All @@ -20,6 +21,7 @@ codeunit 139701 "APIV1 - Accounts E2E"

local procedure Initialize()
begin
LibraryGraphMgt.SetLicenseSafeWorkDate();
IF IsInitialized THEN
EXIT;

Expand Down
2 changes: 2 additions & 0 deletions src/Apps/W1/APIV1/test/src/APIV1AgedAPE2E.Codeunit.al
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ codeunit 139719 "APIV1 - Aged AP E2E"

Subtype = Test;
TestHttpRequestPolicy = AllowAllOutboundRequests;
RequiredTestIsolation = Disabled;
TestPermissions = Disabled;

trigger OnRun()
Expand Down Expand Up @@ -61,6 +62,7 @@ codeunit 139719 "APIV1 - Aged AP E2E"

local procedure Initialize()
begin
LibraryGraphMgt.SetLicenseSafeWorkDate();
IF IsInitialized THEN
EXIT;

Expand Down
2 changes: 2 additions & 0 deletions src/Apps/W1/APIV1/test/src/APIV1AgedARE2E.Codeunit.al
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ codeunit 139720 "APIV1 - Aged AR E2E"

Subtype = Test;
TestHttpRequestPolicy = AllowAllOutboundRequests;
RequiredTestIsolation = Disabled;
TestPermissions = Disabled;

trigger OnRun()
Expand Down Expand Up @@ -61,6 +62,7 @@ codeunit 139720 "APIV1 - Aged AR E2E"

local procedure Initialize()
begin
LibraryGraphMgt.SetLicenseSafeWorkDate();
IF IsInitialized THEN
EXIT;

Expand Down
76 changes: 76 additions & 0 deletions src/Apps/W1/APIV1/test/src/APIV1AttachmentsE2E.Codeunit.al
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ codeunit 139733 "APIV1 - Attachments E2E"

Subtype = Test;
TestHttpRequestPolicy = AllowAllOutboundRequests;
RequiredTestIsolation = Disabled;
TestType = Uncategorized;
TestPermissions = Disabled;

Expand Down Expand Up @@ -44,6 +45,8 @@ codeunit 139733 "APIV1 - Attachments E2E"
TargetURL: Text;
begin
// [SCENARIO] User can retrieve all records from the Attachments API.
Initialize();

// [GIVEN] 2 Attachments in the Incoming Document Attachment table
CreateGenJournalLine(DocumentRecordRef);
CreateAttachments(DocumentRecordRef, AttachmentId);
Expand All @@ -66,6 +69,8 @@ codeunit 139733 "APIV1 - Attachments E2E"
TargetURL: Text;
begin
// [SCENARIO] User can retrieve all records from the Attachments API.
Initialize();

// [GIVEN] 2 Attachments in the Incoming Document Attachment table
CreateGLEntry(DocumentRecordRef);
CreateAttachments(DocumentRecordRef, AttachmentId);
Expand All @@ -89,6 +94,8 @@ codeunit 139733 "APIV1 - Attachments E2E"
TargetURL: Text;
begin
// [SCENARIO] User can retrieve all records from the Attachments API.
Initialize();

// [GIVEN] 2 Attachments in the Incoming Document Attachment table
CreatePostedSalesInvoice(DocumentRecordRef, DocumentId);
CreateAttachments(DocumentRecordRef, AttachmentId);
Expand All @@ -111,6 +118,8 @@ codeunit 139733 "APIV1 - Attachments E2E"
TargetURL: Text;
begin
// [SCENARIO] User can retrieve all records from the Attachments API.
Initialize();

// [GIVEN] 2 Attachments in the Incoming Document Attachment table
CreateDraftSalesInvoice(DocumentRecordRef);
CreateAttachments(DocumentRecordRef, AttachmentId);
Expand All @@ -134,6 +143,8 @@ codeunit 139733 "APIV1 - Attachments E2E"
TargetURL: Text;
begin
// [SCENARIO] User can retrieve all records from the Attachments API.
Initialize();

// [GIVEN] 2 Attachments in the Incoming Document Attachment table
CreatePostedPurchaseInvoice(DocumentRecordRef, DocumentId);
CreateAttachments(DocumentRecordRef, AttachmentId);
Expand All @@ -156,6 +167,8 @@ codeunit 139733 "APIV1 - Attachments E2E"
TargetURL: Text;
begin
// [SCENARIO] User can retrieve all records from the Attachments API.
Initialize();

// [GIVEN] 2 Attachments in the Incoming Document Attachment table
CreateDraftPurchaseInvoice(DocumentRecordRef);
CreateAttachments(DocumentRecordRef, AttachmentId);
Expand All @@ -178,6 +191,8 @@ codeunit 139733 "APIV1 - Attachments E2E"
TargetURL: Text;
begin
// [SCENARIO] User can retrieve all records from the Attachments API.
Initialize();

// [GIVEN] 2 Attachments in the Incoming Document Attachment table
CreateSalesQuote(DocumentRecordRef);
CreateAttachments(DocumentRecordRef, AttachmentId);
Expand All @@ -200,6 +215,8 @@ codeunit 139733 "APIV1 - Attachments E2E"
TargetURL: Text;
begin
// [SCENARIO] User can retrieve the Attachment record from the Attachment API.
Initialize();

// [GIVEN] Attachment exists in the Incoming Document Attachment table
CreateGenJournalLine(DocumentRecordRef);
AttachmentId := CreateAttachment(DocumentRecordRef);
Expand All @@ -225,6 +242,8 @@ codeunit 139733 "APIV1 - Attachments E2E"
TargetURL: Text;
begin
// [SCENARIO] User can retrieve the Attachment record from the Attachment API.
Initialize();

// [GIVEN] Attachment exists in the Incoming Document Attachment table
JournalName := LibraryUtility.GenerateRandomCode(GenJournalBatch.FieldNo(Name), Database::"Gen. Journal Batch");
LibraryAPIGeneralJournal.EnsureGenJnlBatchExists(GraphMgtJournal.GetDefaultJournalLinesTemplateName(), JournalName);
Expand All @@ -250,6 +269,8 @@ codeunit 139733 "APIV1 - Attachments E2E"
TargetURL: Text;
begin
// [SCENARIO] User can retrieve the Attachment record from the Attachment API.
Initialize();

// [GIVEN] Attachment exists in the Incoming Document Attachment table
CreateGLEntry(DocumentRecordRef);
AttachmentId := CreateAttachment(DocumentRecordRef);
Expand All @@ -274,6 +295,8 @@ codeunit 139733 "APIV1 - Attachments E2E"
TargetURL: Text;
begin
// [SCENARIO] User can retrieve the Attachment record from the Attachment API.
Initialize();

// [GIVEN] Attachment exists in the Incoming Document Attachment table
CreatePostedSalesInvoice(DocumentRecordRef, DocumentId);
AttachmentId := CreateAttachment(DocumentRecordRef);
Expand All @@ -297,6 +320,8 @@ codeunit 139733 "APIV1 - Attachments E2E"
TargetURL: Text;
begin
// [SCENARIO] User can retrieve the Attachment record from the Attachment API.
Initialize();

// [GIVEN] Attachment exists in the Incoming Document Attachment table
CreateDraftSalesInvoice(DocumentRecordRef);
AttachmentId := CreateAttachment(DocumentRecordRef);
Expand All @@ -320,6 +345,8 @@ codeunit 139733 "APIV1 - Attachments E2E"
TargetURL: Text;
begin
// [SCENARIO] User can retrieve the Attachment record from the Attachment API.
Initialize();

// [GIVEN] Attachment exists in the Incoming Document Attachment table
CreateSalesQuote(DocumentRecordRef);
AttachmentId := CreateAttachment(DocumentRecordRef);
Expand Down Expand Up @@ -347,6 +374,8 @@ codeunit 139733 "APIV1 - Attachments E2E"
ActualBase64Content: Text;
begin
// [SCENARIO] User can update linked attachment binary content through the Attachment API.
Initialize();

// [GIVEN] A linked attachment exists
CreateGenJournalLine(DocumentRecordRef);
AttachmentId := CreateAttachment(DocumentRecordRef);
Expand Down Expand Up @@ -381,6 +410,8 @@ codeunit 139733 "APIV1 - Attachments E2E"
ActualBase64Content: Text;
begin
// [SCENARIO] User can update linked attachment binary content through the Attachment API.
Initialize();

// [GIVEN] A linked attachment exists
CreateGLEntry(DocumentRecordRef);
AttachmentId := CreateAttachment(DocumentRecordRef);
Expand Down Expand Up @@ -408,6 +439,8 @@ codeunit 139733 "APIV1 - Attachments E2E"
var
DocumentRecordRef: RecordRef;
begin
Initialize();

CreateGenJournalLine(DocumentRecordRef);
TestCreateAttachment(DocumentRecordRef);
end;
Expand All @@ -417,6 +450,8 @@ codeunit 139733 "APIV1 - Attachments E2E"
var
DocumentRecordRef: RecordRef;
begin
Initialize();

CreateGLEntry(DocumentRecordRef);
TestCreateGLEAttachment(DocumentRecordRef);
end;
Expand All @@ -427,6 +462,8 @@ codeunit 139733 "APIV1 - Attachments E2E"
DocumentRecordRef: RecordRef;
DocumentId: Guid;
begin
Initialize();

CreatePostedSalesInvoice(DocumentRecordRef, DocumentId);
TestCreateAttachment(DocumentRecordRef, DocumentId);
end;
Expand All @@ -436,6 +473,8 @@ codeunit 139733 "APIV1 - Attachments E2E"
var
DocumentRecordRef: RecordRef;
begin
Initialize();

CreateDraftSalesInvoice(DocumentRecordRef);
TestCreateAttachment(DocumentRecordRef);
end;
Expand All @@ -446,6 +485,8 @@ codeunit 139733 "APIV1 - Attachments E2E"
DocumentRecordRef: RecordRef;
DocumentId: Guid;
begin
Initialize();

CreatePostedPurchaseInvoice(DocumentRecordRef, DocumentId);
TestCreateAttachment(DocumentRecordRef, DocumentId);
end;
Expand All @@ -455,10 +496,17 @@ codeunit 139733 "APIV1 - Attachments E2E"
var
DocumentRecordRef: RecordRef;
begin
Initialize();

CreateDraftPurchaseInvoice(DocumentRecordRef);
TestCreateAttachment(DocumentRecordRef);
end;

local procedure Initialize()
begin
LibraryGraphMgt.SetLicenseSafeWorkDate();
end;

local procedure TestCreateAttachment(var DocumentRecordRef: RecordRef)
var
DocumentId: Guid;
Expand Down Expand Up @@ -556,6 +604,8 @@ codeunit 139733 "APIV1 - Attachments E2E"
var
DocumentRecordRef: RecordRef;
begin
Initialize();

CreateSalesQuote(DocumentRecordRef);
TestCreateAttachment(DocumentRecordRef);
end;
Expand All @@ -565,6 +615,8 @@ codeunit 139733 "APIV1 - Attachments E2E"
var
DocumentRecordRef: RecordRef;
begin
Initialize();

CreateGenJournalLine(DocumentRecordRef);
TestDeleteAttachment(DocumentRecordRef);
end;
Expand All @@ -574,6 +626,8 @@ codeunit 139733 "APIV1 - Attachments E2E"
var
DocumentRecordRef: RecordRef;
begin
Initialize();

CreateGLEntry(DocumentRecordRef);
TestDeleteGLEAttachment(DocumentRecordRef);
end;
Expand All @@ -584,6 +638,8 @@ codeunit 139733 "APIV1 - Attachments E2E"
DocumentRecordRef: RecordRef;
DocumentId: Guid;
begin
Initialize();

CreatePostedSalesInvoice(DocumentRecordRef, DocumentId);
TestDeleteAttachment(DocumentRecordRef, DocumentId);
end;
Expand All @@ -593,6 +649,8 @@ codeunit 139733 "APIV1 - Attachments E2E"
var
DocumentRecordRef: RecordRef;
begin
Initialize();

CreateDraftSalesInvoice(DocumentRecordRef);
TestDeleteAttachment(DocumentRecordRef);
end;
Expand All @@ -603,6 +661,8 @@ codeunit 139733 "APIV1 - Attachments E2E"
DocumentRecordRef: RecordRef;
DocumentId: Guid;
begin
Initialize();

CreatePostedPurchaseInvoice(DocumentRecordRef, DocumentId);
TestDeleteAttachment(DocumentRecordRef, DocumentId);
end;
Expand All @@ -612,6 +672,8 @@ codeunit 139733 "APIV1 - Attachments E2E"
var
DocumentRecordRef: RecordRef;
begin
Initialize();

CreateDraftPurchaseInvoice(DocumentRecordRef);
TestDeleteAttachment(DocumentRecordRef);
end;
Expand All @@ -621,6 +683,8 @@ codeunit 139733 "APIV1 - Attachments E2E"
var
DocumentRecordRef: RecordRef;
begin
Initialize();

CreateSalesQuote(DocumentRecordRef);
TestDeleteAttachment(DocumentRecordRef);
end;
Expand Down Expand Up @@ -698,6 +762,8 @@ codeunit 139733 "APIV1 - Attachments E2E"
TargetURL: Text;
begin
// [SCENARIO] The Attachment is transferred from a Draft Invoice the to Posted Invoice after posting.
Initialize();

// [GIVEN] A draft sales invoice exists.
CreateDraftSalesInvoice(DocumentRecordRef);
DocumentId := GetDocumentId(DocumentRecordRef);
Expand Down Expand Up @@ -738,6 +804,8 @@ codeunit 139733 "APIV1 - Attachments E2E"
TargetURL: Text;
begin
// [SCENARIO] The Attachment is transferred from a Draft Invoice the to Posted Invoice after posting.
Initialize();

// [GIVEN] A draft sales invoice exists.
CreateDraftPurchaseInvoice(DocumentRecordRef);
DocumentId := GetDocumentId(DocumentRecordRef);
Expand Down Expand Up @@ -780,6 +848,8 @@ codeunit 139733 "APIV1 - Attachments E2E"
NewBase64Content: Text;
begin
// [SCENARIO] Changing an attachment file name keeps other fields unchanged
Initialize();

// [GIVEN] A sales quote exists.
CreateSalesQuote(DocumentRecordRef);
DocumentId := GetDocumentId(DocumentRecordRef);
Expand Down Expand Up @@ -825,6 +895,8 @@ codeunit 139733 "APIV1 - Attachments E2E"
NewFileName: Text;
begin
// [SCENARIO] Changing an attachment content keeps other fields unchanged
Initialize();

// [GIVEN] A draft sales invoice exists.
CreateDraftSalesInvoice(DocumentRecordRef);
DocumentId := GetDocumentId(DocumentRecordRef);
Expand Down Expand Up @@ -863,6 +935,8 @@ codeunit 139733 "APIV1 - Attachments E2E"
JSONBody: Text;
begin
// [SCENARIO] User cannot change the linked attachment ID by making a PATCH request to the Attachments API
Initialize();

// [GIVEN] A sales quote exists.
CreateSalesQuote(DocumentRecordRef);

Expand Down Expand Up @@ -892,6 +966,8 @@ codeunit 139733 "APIV1 - Attachments E2E"
JSONBody: Text;
begin
// [SCENARIO] User cannot change the attachment ID by making a PATCH request to the Attachments API
Initialize();

// [GIVEN] Two documents exist.
CreateSalesQuote(DocumentRecordRef[1]);
CreateDraftSalesInvoice(DocumentRecordRef[2]);
Expand Down
Loading
Loading