Skip to content

Commit dac3dc5

Browse files
lillie-daeJoeBatt1989
authored andcommitted
update to interation tests
Signed-off-by: Lillie Dae <[email protected]>
1 parent 1a9818e commit dac3dc5

File tree

4 files changed

+27
-22
lines changed

4 files changed

+27
-22
lines changed

src/WorkflowManager/Database/Repositories/WorkflowRepository.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,11 +206,15 @@ public async Task<IList<WorkflowRevision>> GetWorkflowsForWorkflowRequestAsync(s
206206

207207
var wfs = await _workflowCollection
208208
.Find(x =>
209-
x.Deleted == null &&
210209
x.Workflow != null &&
211210
x.Workflow.InformaticsGateway != null &&
212-
(x.Workflow.InformaticsGateway.AeTitle == calledAeTitle && x.Workflow.InformaticsGateway.DataOrigins.Length == 0 ||
213-
x.Workflow.InformaticsGateway.AeTitle == calledAeTitle && x.Workflow.InformaticsGateway.DataOrigins.Contains(callingAeTitle)))
211+
((x.Workflow.InformaticsGateway.AeTitle == calledAeTitle &&
212+
(x.Workflow.InformaticsGateway.DataOrigins == null ||
213+
x.Workflow.InformaticsGateway.DataOrigins.Length == 0)) ||
214+
x.Workflow.InformaticsGateway.AeTitle == calledAeTitle &&
215+
x.Workflow.InformaticsGateway.DataOrigins != null &&
216+
x.Workflow.InformaticsGateway.DataOrigins.Any(d => d == callingAeTitle)) &&
217+
x.Deleted == null)
214218
.ToListAsync();
215219
return wfs;
216220
}

tests/IntegrationTests/WorkflowExecutor.IntegrationTests/TestData/WorkflowRequestTestData.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ public static class WorkflowRequestsTestData
3939
Workflows = new List<string>() { },
4040
CorrelationId = Guid.NewGuid().ToString(),
4141
Timestamp = DateTime.UtcNow,
42-
CalledAeTitle = "Basic_AE",
43-
CallingAeTitle = "Basic_AE_3",
42+
CalledAeTitle = "MONAI",
43+
CallingAeTitle = "PACS",
4444
}
4545
},
4646
new WorkflowRequestTestData
@@ -95,7 +95,7 @@ public static class WorkflowRequestsTestData
9595
Workflows = new List<string>() { },
9696
CorrelationId = Guid.NewGuid().ToString(),
9797
Timestamp = DateTime.UtcNow,
98-
CalledAeTitle = "Multi_Revision",
98+
CalledAeTitle = "MONAI_2",
9999
CallingAeTitle = "MWM",
100100
}
101101
},
@@ -258,8 +258,8 @@ public static class WorkflowRequestsTestData
258258
Workflows = new List<string>() { },
259259
CorrelationId = Guid.NewGuid().ToString(),
260260
Timestamp = DateTime.UtcNow,
261-
CalledAeTitle = "MWM",
262-
CallingAeTitle = "Basic_AE",
261+
CalledAeTitle = "MONAI",
262+
CallingAeTitle = "PACS",
263263
}
264264
},
265265
new WorkflowRequestTestData
@@ -272,8 +272,8 @@ public static class WorkflowRequestsTestData
272272
Workflows = new List<string>() { },
273273
CorrelationId = Guid.NewGuid().ToString(),
274274
Timestamp = DateTime.UtcNow,
275-
CalledAeTitle = "Basic_AE",
276-
CallingAeTitle = "MWM",
275+
CalledAeTitle = "MONAI",
276+
CallingAeTitle = "PACS",
277277
}
278278
},
279279
new WorkflowRequestTestData
@@ -286,8 +286,8 @@ public static class WorkflowRequestsTestData
286286
Workflows = new List<string>() { },
287287
CorrelationId = Guid.NewGuid().ToString(),
288288
Timestamp = DateTime.UtcNow,
289-
CalledAeTitle = "Basic_AE",
290-
CallingAeTitle = "MWM",
289+
CalledAeTitle = "MONAI",
290+
CallingAeTitle = "PACS",
291291
}
292292
},
293293
new WorkflowRequestTestData

tests/IntegrationTests/WorkflowExecutor.IntegrationTests/TestData/WorkflowRevisionTestData.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public static class WorkflowRevisionsTestData
5454
},
5555
InformaticsGateway = new InformaticsGateway()
5656
{
57-
AeTitle = "Basic_AE"
57+
AeTitle = "MONAI"
5858
}
5959
}
6060
}
@@ -84,7 +84,7 @@ public static class WorkflowRevisionsTestData
8484
},
8585
InformaticsGateway = new InformaticsGateway()
8686
{
87-
AeTitle = "Basic_AE"
87+
AeTitle = "MONAI"
8888
}
8989
}
9090
}
@@ -114,7 +114,7 @@ public static class WorkflowRevisionsTestData
114114
},
115115
InformaticsGateway = new InformaticsGateway()
116116
{
117-
AeTitle = "Basic_AE_3"
117+
AeTitle = "MONAI"
118118
}
119119
}
120120
}
@@ -181,7 +181,7 @@ public static class WorkflowRevisionsTestData
181181
},
182182
new WorkflowRevisionTestData()
183183
{
184-
Name = "Basic_Workflow_Multiple_Revisions_1",
184+
Name = "Basic_Workflow_Multiple_Revisions_1", //not to be confused with 'Basic_Workflow_multiple_revisions_1' (lower case)
185185
WorkflowRevision = new WorkflowRevision()
186186
{
187187
Id = Guid.NewGuid().ToString(),
@@ -204,7 +204,7 @@ public static class WorkflowRevisionsTestData
204204
},
205205
InformaticsGateway = new InformaticsGateway()
206206
{
207-
AeTitle = "Multi_Revision"
207+
AeTitle = "MONAI"
208208
}
209209
}
210210
}
@@ -234,7 +234,7 @@ public static class WorkflowRevisionsTestData
234234
},
235235
InformaticsGateway = new InformaticsGateway()
236236
{
237-
AeTitle = "Multi_Revision"
237+
AeTitle = "MONAI_2"
238238
}
239239
}
240240
}
@@ -331,7 +331,7 @@ public static class WorkflowRevisionsTestData
331331
},
332332
InformaticsGateway = new InformaticsGateway()
333333
{
334-
AeTitle = "Multi_Created"
334+
AeTitle = "Multi_Req"
335335
}
336336
}
337337
}
@@ -675,7 +675,7 @@ public static class WorkflowRevisionsTestData
675675
},
676676
new WorkflowRevisionTestData()
677677
{
678-
Name = "Basic_Workflow_multiple_revisions_1",
678+
Name = "Basic_Workflow_multiple_revisions_1", //not to be confused with 'Basic_Workflow_Multiple_Revisions_1' (upper case)
679679
WorkflowRevision = new WorkflowRevision()
680680
{
681681
Id = Guid.NewGuid().ToString(),
@@ -698,7 +698,7 @@ public static class WorkflowRevisionsTestData
698698
},
699699
InformaticsGateway = new InformaticsGateway()
700700
{
701-
AeTitle = "Basic_AE"
701+
AeTitle = "MONAI_2"
702702
}
703703
}
704704
}
@@ -728,7 +728,7 @@ public static class WorkflowRevisionsTestData
728728
},
729729
InformaticsGateway = new InformaticsGateway()
730730
{
731-
AeTitle = "Basic_AE"
731+
AeTitle = "MONAI_2"
732732
}
733733
}
734734
}

tests/UnitTests/WorkflowExecuter.Tests/Services/WorkflowExecuterServiceTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ public async Task ProcessPayload_ValidAeTitleWorkflowRequest_ReturnesTrue()
143143
};
144144

145145
_workflowRepository.Setup(w => w.GetWorkflowsByAeTitleAsync(It.IsAny<List<string>>())).ReturnsAsync(workflows);
146+
_workflowRepository.Setup(w => w.GetWorkflowsForWorkflowRequestAsync(It.IsAny<string>(), It.IsAny<string>())).ReturnsAsync(workflows);
146147
_workflowRepository.Setup(w => w.GetByWorkflowIdAsync(workflows[0].WorkflowId)).ReturnsAsync(workflows[0]);
147148
_workflowInstanceRepository.Setup(w => w.CreateAsync(It.IsAny<List<WorkflowInstance>>())).ReturnsAsync(true);
148149
_workflowInstanceRepository.Setup(w => w.GetByWorkflowsIdsAsync(It.IsAny<List<string>>())).ReturnsAsync(new List<WorkflowInstance>());

0 commit comments

Comments
 (0)