From 59c06dc88f0c5921ee32f864f9ffa059e1172bbe Mon Sep 17 00:00:00 2001 From: Mike Cantelon Date: Thu, 7 Nov 2024 03:28:10 -0800 Subject: [PATCH] Using variables for task IDs --- internal/workflow/processing_test.go | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/internal/workflow/processing_test.go b/internal/workflow/processing_test.go index 5f5bbb80..31066a36 100644 --- a/internal/workflow/processing_test.go +++ b/internal/workflow/processing_test.go @@ -613,9 +613,10 @@ func (s *ProcessingWorkflowTestSuite) TestAutoApprovedAIP() { func (s *ProcessingWorkflowTestSuite) TestAMWorkflow() { pkgID := 1 + paID := 1 + valPREMISTaskID := 102 watcherName := "watcher" key := "transfer.zip" - paID := 1 retentionPeriod := 1 * time.Second ctx := mock.AnythingOfType("*context.valueCtx") sessionCtx := mock.AnythingOfType("*context.timerCtx") @@ -685,7 +686,7 @@ func (s *ProcessingWorkflowTestSuite) TestAMWorkflow() { PreservationActionID: paID, }, }, - ).Return(102, nil) + ).Return(valPREMISTaskID, nil) s.env.OnActivity(xmlvalidate.Name, sessionCtx, &xmlvalidate.Params{XMLPath: filepath.Join(extractPath, "data", "metadata", "premis.xml"), XSDPath: ""}, @@ -698,7 +699,7 @@ func (s *ProcessingWorkflowTestSuite) TestAMWorkflow() { ctx, pkgsvc, &completePreservationTaskLocalActivityParams{ - ID: 102, + ID: valPREMISTaskID, Status: enums.PreservationTaskStatusDone, CompletedAt: startTime, Note: ref.New("PREMIS is valid"), @@ -1343,6 +1344,8 @@ func (s *ProcessingWorkflowTestSuite) TestFailedPIPA3m() { s.SetupWorkflowTest(cfg) pkgID := 1 + valBagTaskID := 101 + valPREMISTaskID := 102 watcherName := "watcher" key := "transfer.zip" retentionPeriod := 1 * time.Second @@ -1417,7 +1420,7 @@ func (s *ProcessingWorkflowTestSuite) TestFailedPIPA3m() { PreservationActionID: 1, }, }, - ).Return(101, nil) + ).Return(valBagTaskID, nil) s.env.OnActivity( bagvalidate.Name, @@ -1430,7 +1433,7 @@ func (s *ProcessingWorkflowTestSuite) TestFailedPIPA3m() { ctx, pkgsvc, &completePreservationTaskLocalActivityParams{ - ID: 101, + ID: valBagTaskID, Status: enums.PreservationTaskStatusDone, CompletedAt: startTime, Note: ref.New("Bag is valid"), @@ -1453,7 +1456,7 @@ func (s *ProcessingWorkflowTestSuite) TestFailedPIPA3m() { PreservationActionID: 1, }, }, - ).Return(102, nil) + ).Return(valPREMISTaskID, nil) s.env.OnActivity( xmlvalidate.Name, @@ -1466,7 +1469,7 @@ func (s *ProcessingWorkflowTestSuite) TestFailedPIPA3m() { ctx, pkgsvc, &completePreservationTaskLocalActivityParams{ - ID: 102, + ID: valPREMISTaskID, Status: enums.PreservationTaskStatusDone, CompletedAt: startTime, Note: ref.New("PREMIS is valid"), @@ -1542,6 +1545,7 @@ func (s *ProcessingWorkflowTestSuite) TestFailedPIPAM() { s.SetupWorkflowTest(cfg) pkgID := 1 + valPREMISTaskID := 102 watcherName := "watcher" key := "transfer.zip" paID := 1 @@ -1610,7 +1614,7 @@ func (s *ProcessingWorkflowTestSuite) TestFailedPIPAM() { PreservationActionID: paID, }, }, - ).Return(102, nil) + ).Return(valPREMISTaskID, nil) s.env.OnActivity( xmlvalidate.Name, @@ -1623,7 +1627,7 @@ func (s *ProcessingWorkflowTestSuite) TestFailedPIPAM() { ctx, pkgsvc, &completePreservationTaskLocalActivityParams{ - ID: 102, + ID: valPREMISTaskID, Status: enums.PreservationTaskStatusDone, CompletedAt: startTime, Note: ref.New("PREMIS is valid"),