Skip to content

Commit 1d56a22

Browse files
committed
Integration tests for data_origins
Signed-off-by: Joe Batt <[email protected]>
1 parent dac3dc5 commit 1d56a22

File tree

3 files changed

+157
-0
lines changed

3 files changed

+157
-0
lines changed

tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Features/WorkflowRequest.feature

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,29 @@ Scenario Outline: Publish a valid workflow request which creates multiple workfl
4242
| Basic_Workflow_1 | Basic_Workflow_2 | Basic_Multi_Id_WF_Request |
4343
| Basic_Workflow_1 | Basic_Workflow_3 | Basic_AeTitle_WF_Request |
4444

45+
@WorkflowRequest
46+
Scenario Outline: Publish a workflow request which triggers a worflow based on called_aet and calling_aet
47+
Given I have a clinical workflow <workflow>
48+
When I publish a Workflow Request Message <workflowRequestMessage> with no artifacts
49+
Then I can see 1 Workflow Instance is created
50+
And 1 Task Dispatch event is published
51+
Examples:
52+
| workflow | workflowRequestMessage |
53+
| Workflow_Called_AET | Called_AET_AIDE_Calling_AET_TEST |
54+
| Workflow_Called_AET_Calling_AET | Called_AET_AIDE_Calling_AET_PACS1 |
55+
| Workflow_Called_AET_Multi_Calling_AET | Called_AET_AIDE_Calling_AET_PACS1 |
56+
| Workflow_Called_AET_Multi_Calling_AET | Called_AET_AIDE_Calling_AET_PACS2 |
57+
58+
@WorkflowRequest
59+
Scenario Outline: Publish a workflow request which doesnt trigger a worflow based calling_aet
60+
Given I have a clinical workflow <workflow>
61+
When I publish a Workflow Request Message <workflowRequestMessage> with no artifacts
62+
Then I can see no Workflow Instances are created
63+
Examples:
64+
| workflow | workflowRequestMessage |
65+
| Workflow_Called_AET_Calling_AET | Called_AET_AIDE_Calling_AET_TEST |
66+
| Workflow_Called_AET_Multi_Calling_AET | Called_AET_AIDE_Calling_AET_TEST |
67+
4568
@WorkflowRequest
4669
Scenario: Publish a valid workflow request with mismatched AE title and workflow ID
4770
Given I have a clinical workflow Basic_Workflow_1

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

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,48 @@ public static class WorkflowRequestsTestData
346346
CallingAeTitle = "Non_Existent_Calling_AE",
347347
}
348348
},
349+
new WorkflowRequestTestData
350+
{
351+
Name = "Called_AET_AIDE_Calling_AET_TEST",
352+
WorkflowRequestMessage = new WorkflowRequestMessage
353+
{
354+
Bucket = "bucket1",
355+
PayloadId = Guid.NewGuid(),
356+
Workflows = new List<string>() { },
357+
CorrelationId = Guid.NewGuid().ToString(),
358+
Timestamp = DateTime.UtcNow,
359+
CalledAeTitle = "AIDE",
360+
CallingAeTitle = "TEST",
361+
}
362+
},
363+
new WorkflowRequestTestData
364+
{
365+
Name = "Called_AET_AIDE_Calling_AET_PACS1",
366+
WorkflowRequestMessage = new WorkflowRequestMessage
367+
{
368+
Bucket = "bucket1",
369+
PayloadId = Guid.NewGuid(),
370+
Workflows = new List<string>() { },
371+
CorrelationId = Guid.NewGuid().ToString(),
372+
Timestamp = DateTime.UtcNow,
373+
CalledAeTitle = "AIDE",
374+
CallingAeTitle = "PACS1",
375+
}
376+
},
377+
new WorkflowRequestTestData
378+
{
379+
Name = "Called_AET_AIDE_Calling_AET_PACS2",
380+
WorkflowRequestMessage = new WorkflowRequestMessage
381+
{
382+
Bucket = "bucket1",
383+
PayloadId = Guid.NewGuid(),
384+
Workflows = new List<string>() { },
385+
CorrelationId = Guid.NewGuid().ToString(),
386+
Timestamp = DateTime.UtcNow,
387+
CalledAeTitle = "AIDE",
388+
CallingAeTitle = "PACS2",
389+
}
390+
},
349391
};
350392
}
351393
}

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

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3036,6 +3036,98 @@ public static class WorkflowRevisionsTestData
30363036
}
30373037
}
30383038
},
3039+
new WorkflowRevisionTestData()
3040+
{
3041+
Name = "Workflow_Called_AET",
3042+
WorkflowRevision = new WorkflowRevision()
3043+
{
3044+
Id = Guid.NewGuid().ToString(),
3045+
WorkflowId = Guid.NewGuid().ToString(),
3046+
Revision = 1,
3047+
Workflow = new Workflow()
3048+
{
3049+
Name = "Basic workflow 1",
3050+
Description = "Basic workflow 1",
3051+
Version = "1",
3052+
Tasks = new TaskObject[]
3053+
{
3054+
new TaskObject
3055+
{
3056+
Id = Guid.NewGuid().ToString(),
3057+
Type = "Basic_task",
3058+
Description = "Basic Workflow 1 Task 1",
3059+
Artifacts = new ArtifactMap(),
3060+
}
3061+
},
3062+
InformaticsGateway = new InformaticsGateway()
3063+
{
3064+
AeTitle = "AIDE"
3065+
}
3066+
}
3067+
}
3068+
},
3069+
new WorkflowRevisionTestData()
3070+
{
3071+
Name = "Workflow_Called_AET_Calling_AET",
3072+
WorkflowRevision = new WorkflowRevision()
3073+
{
3074+
Id = Guid.NewGuid().ToString(),
3075+
WorkflowId = Guid.NewGuid().ToString(),
3076+
Revision = 1,
3077+
Workflow = new Workflow()
3078+
{
3079+
Name = "Basic workflow 1",
3080+
Description = "Basic workflow 1",
3081+
Version = "1",
3082+
Tasks = new TaskObject[]
3083+
{
3084+
new TaskObject
3085+
{
3086+
Id = Guid.NewGuid().ToString(),
3087+
Type = "Basic_task",
3088+
Description = "Basic Workflow 1 Task 1",
3089+
Artifacts = new ArtifactMap(),
3090+
}
3091+
},
3092+
InformaticsGateway = new InformaticsGateway()
3093+
{
3094+
AeTitle = "AIDE",
3095+
DataOrigins = new string[] { "PACS1" }
3096+
}
3097+
}
3098+
}
3099+
},
3100+
new WorkflowRevisionTestData()
3101+
{
3102+
Name = "Workflow_Called_AET_Multi_Calling_AET",
3103+
WorkflowRevision = new WorkflowRevision()
3104+
{
3105+
Id = Guid.NewGuid().ToString(),
3106+
WorkflowId = Guid.NewGuid().ToString(),
3107+
Revision = 1,
3108+
Workflow = new Workflow()
3109+
{
3110+
Name = "Basic workflow 1",
3111+
Description = "Basic workflow 1",
3112+
Version = "1",
3113+
Tasks = new TaskObject[]
3114+
{
3115+
new TaskObject
3116+
{
3117+
Id = Guid.NewGuid().ToString(),
3118+
Type = "Basic_task",
3119+
Description = "Basic Workflow 1 Task 1",
3120+
Artifacts = new ArtifactMap(),
3121+
}
3122+
},
3123+
InformaticsGateway = new InformaticsGateway()
3124+
{
3125+
AeTitle = "AIDE",
3126+
DataOrigins = new string[] { "PACS1", "PACS2" }
3127+
}
3128+
}
3129+
}
3130+
},
30393131
};
30403132
}
30413133
}

0 commit comments

Comments
 (0)