Skip to content

Commit

Permalink
Using variables for task IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
mcantelon committed Nov 7, 2024
1 parent 3ed2161 commit 59c06dc
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions internal/workflow/processing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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: ""},
Expand All @@ -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"),
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -1417,7 +1420,7 @@ func (s *ProcessingWorkflowTestSuite) TestFailedPIPA3m() {
PreservationActionID: 1,
},
},
).Return(101, nil)
).Return(valBagTaskID, nil)

s.env.OnActivity(
bagvalidate.Name,
Expand All @@ -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"),
Expand All @@ -1453,7 +1456,7 @@ func (s *ProcessingWorkflowTestSuite) TestFailedPIPA3m() {
PreservationActionID: 1,
},
},
).Return(102, nil)
).Return(valPREMISTaskID, nil)

s.env.OnActivity(
xmlvalidate.Name,
Expand All @@ -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"),
Expand Down Expand Up @@ -1542,6 +1545,7 @@ func (s *ProcessingWorkflowTestSuite) TestFailedPIPAM() {
s.SetupWorkflowTest(cfg)

pkgID := 1
valPREMISTaskID := 102
watcherName := "watcher"
key := "transfer.zip"
paID := 1
Expand Down Expand Up @@ -1610,7 +1614,7 @@ func (s *ProcessingWorkflowTestSuite) TestFailedPIPAM() {
PreservationActionID: paID,
},
},
).Return(102, nil)
).Return(valPREMISTaskID, nil)

s.env.OnActivity(
xmlvalidate.Name,
Expand All @@ -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"),
Expand Down

0 comments on commit 59c06dc

Please sign in to comment.