Skip to content

Commit 46c5840

Browse files
committed
Rename plug-ins
Signed-off-by: Victor Chang <[email protected]>
1 parent 244c6f3 commit 46c5840

File tree

5 files changed

+37
-34
lines changed

5 files changed

+37
-34
lines changed

src/Plug-ins/RemoteAppExecution/ExternalAppOutgoing.cs renamed to src/Plug-ins/RemoteAppExecution/DicomDeidentifier.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@
2828
namespace Monai.Deploy.InformaticsGateway.PlugIns.RemoteAppExecution
2929
{
3030
[PlugInName("Remote App Execution Outgoing")]
31-
public class ExternalAppOutgoing : IOutputDataPlugIn
31+
public class DicomDeidentifier : IOutputDataPlugIn
3232
{
33-
private readonly ILogger<ExternalAppOutgoing> _logger;
33+
private readonly ILogger<DicomDeidentifier> _logger;
3434
private readonly IServiceScopeFactory _serviceScopeFactory;
3535
private readonly PlugInConfiguration _options;
3636

3737
public string Name => GetType().GetCustomAttribute<PlugInNameAttribute>()?.Name ?? GetType().Name;
3838

39-
public ExternalAppOutgoing(
40-
ILogger<ExternalAppOutgoing> logger,
39+
public DicomDeidentifier(
40+
ILogger<DicomDeidentifier> logger,
4141
IServiceScopeFactory serviceScopeFactory,
4242
IOptions<PlugInConfiguration> configuration)
4343
{

src/Plug-ins/RemoteAppExecution/ExternalAppIncoming.cs renamed to src/Plug-ins/RemoteAppExecution/DicomReidentifier.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@
2525
namespace Monai.Deploy.InformaticsGateway.PlugIns.RemoteAppExecution
2626
{
2727
[PlugInName("Remote App Execution Incoming")]
28-
public class ExternalAppIncoming : IInputDataPlugIn
28+
public class DicomReidentifier : IInputDataPlugIn
2929
{
30-
private readonly ILogger<ExternalAppIncoming> _logger;
30+
private readonly ILogger<DicomReidentifier> _logger;
3131
private readonly IServiceScopeFactory _serviceScopeFactory;
3232

3333
public string Name => GetType().GetCustomAttribute<PlugInNameAttribute>()?.Name ?? GetType().Name;
3434

35-
public ExternalAppIncoming(
36-
ILogger<ExternalAppIncoming> logger,
35+
public DicomReidentifier(
36+
ILogger<DicomReidentifier> logger,
3737
IServiceScopeFactory serviceScopeFactory)
3838
{
3939
_logger = logger ?? throw new ArgumentNullException(nameof(logger));

src/Plug-ins/RemoteAppExecution/Test/ExternalAppOutgoingTest.cs renamed to src/Plug-ins/RemoteAppExecution/Test/DicomDeidentifierTest.cs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,19 @@
3030

3131
namespace Monai.Deploy.InformaticsGateway.PlugIns.RemoteAppExecution.Test
3232
{
33-
public class ExternalAppOutgoingTest
33+
public class DicomDeidentifierTest
3434
{
35-
private readonly Mock<ILogger<ExternalAppOutgoing>> _logger;
35+
private readonly Mock<ILogger<DicomDeidentifier>> _logger;
3636
private readonly Mock<IServiceScopeFactory> _serviceScopeFactory;
3737
private readonly ServiceCollection _serviceCollection;
3838
private readonly Mock<IRemoteAppExecutionRepository> _repository;
3939
private readonly IOptions<PlugInConfiguration> _options;
4040
private readonly Mock<IServiceScope> _serviceScope;
4141
private readonly ServiceProvider _serviceProvider;
4242

43-
public ExternalAppOutgoingTest()
43+
public DicomDeidentifierTest()
4444
{
45-
_logger = new Mock<ILogger<ExternalAppOutgoing>>();
45+
_logger = new Mock<ILogger<DicomDeidentifier>>();
4646
_serviceScopeFactory = new Mock<IServiceScopeFactory>();
4747
_repository = new Mock<IRemoteAppExecutionRepository>();
4848
_serviceScope = new Mock<IServiceScope>();
@@ -61,15 +61,15 @@ public ExternalAppOutgoingTest()
6161
}
6262

6363
[Fact]
64-
public void GivenExternalAppOutgoing_TestConstructors()
64+
public void GivenDicomDeidentifier_TestConstructors()
6565
{
66-
Assert.Throws<ArgumentNullException>(() => new ExternalAppOutgoing(null, null, null));
67-
Assert.Throws<ArgumentNullException>(() => new ExternalAppOutgoing(_logger.Object, null, null));
68-
Assert.Throws<ArgumentNullException>(() => new ExternalAppOutgoing(_logger.Object, _serviceScopeFactory.Object, null));
69-
Assert.Throws<ArgumentNullException>(() => new ExternalAppOutgoing(_logger.Object, _serviceScopeFactory.Object, _options));
66+
Assert.Throws<ArgumentNullException>(() => new DicomDeidentifier(null, null, null));
67+
Assert.Throws<ArgumentNullException>(() => new DicomDeidentifier(_logger.Object, null, null));
68+
Assert.Throws<ArgumentNullException>(() => new DicomDeidentifier(_logger.Object, _serviceScopeFactory.Object, null));
69+
Assert.Throws<ArgumentNullException>(() => new DicomDeidentifier(_logger.Object, _serviceScopeFactory.Object, _options));
7070

7171
_options.Value.RemoteAppConfigurations.Add(SR.ConfigKey_ReplaceTags, "tag1, tag2");
72-
var app = new ExternalAppOutgoing(_logger.Object, _serviceScopeFactory.Object, _options);
72+
var app = new DicomDeidentifier(_logger.Object, _serviceScopeFactory.Object, _options);
7373

7474
Assert.Equal(app.Name, app.GetType().GetCustomAttribute<PlugInNameAttribute>()!.Name);
7575
}
@@ -78,7 +78,7 @@ public void GivenExternalAppOutgoing_TestConstructors()
7878
public async Task GivenEmptyReplaceTags_WhenExecuteIsCalledWithoutExistingRecords_ExpectAsync()
7979
{
8080
_options.Value.RemoteAppConfigurations.Add(SR.ConfigKey_ReplaceTags, string.Empty);
81-
var app = new ExternalAppOutgoing(_logger.Object, _serviceScopeFactory.Object, _options);
81+
var app = new DicomDeidentifier(_logger.Object, _serviceScopeFactory.Object, _options);
8282

8383
var studyInstanceUid = DicomUIDGenerator.GenerateDerivedFromUUID().UID;
8484
var seriesInstanceUid = DicomUIDGenerator.GenerateDerivedFromUUID().UID;
@@ -106,7 +106,7 @@ public async Task GivenReplaceTags_WhenExecuteIsCalledWithoutExistingRecords_Exp
106106
{
107107
_options.Value.RemoteAppConfigurations.Add(SR.ConfigKey_ReplaceTags, "StudyInstanceUID,AccessionNumber,PatientID,PatientName");
108108

109-
var app = new ExternalAppOutgoing(_logger.Object, _serviceScopeFactory.Object, _options);
109+
var app = new DicomDeidentifier(_logger.Object, _serviceScopeFactory.Object, _options);
110110

111111
var studyInstanceUid = DicomUIDGenerator.GenerateDerivedFromUUID().UID;
112112
var seriesInstanceUid = DicomUIDGenerator.GenerateDerivedFromUUID().UID;
@@ -139,7 +139,7 @@ public async Task GivenReplaceTags_WhenExecuteIsCalledWithoutExistingRecords_Exp
139139
public async Task GivenExistingRecordWithSameStudy_WhenExecuteIsCalled_ExpectAsync()
140140
{
141141
_options.Value.RemoteAppConfigurations.Add(SR.ConfigKey_ReplaceTags, string.Empty);
142-
var app = new ExternalAppOutgoing(_logger.Object, _serviceScopeFactory.Object, _options);
142+
var app = new DicomDeidentifier(_logger.Object, _serviceScopeFactory.Object, _options);
143143

144144
var studyInstanceUid = DicomUIDGenerator.GenerateDerivedFromUUID().UID;
145145
var seriesInstanceUid = DicomUIDGenerator.GenerateDerivedFromUUID().UID;
@@ -175,7 +175,7 @@ public async Task GivenExistingRecordWithSameStudy_WhenExecuteIsCalled_ExpectAsy
175175
public async Task GivenExistingRecordWithSameSeries_WhenExecuteIsCalled_ExpectAsync()
176176
{
177177
_options.Value.RemoteAppConfigurations.Add(SR.ConfigKey_ReplaceTags, string.Empty);
178-
var app = new ExternalAppOutgoing(_logger.Object, _serviceScopeFactory.Object, _options);
178+
var app = new DicomDeidentifier(_logger.Object, _serviceScopeFactory.Object, _options);
179179

180180
var studyInstanceUid = DicomUIDGenerator.GenerateDerivedFromUUID().UID;
181181
var seriesInstanceUid = DicomUIDGenerator.GenerateDerivedFromUUID().UID;

src/Plug-ins/RemoteAppExecution/Test/ExternalAppIncomingTest.cs renamed to src/Plug-ins/RemoteAppExecution/Test/DicomReidentifierTest.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,18 @@
2727

2828
namespace Monai.Deploy.InformaticsGateway.PlugIns.RemoteAppExecution.Test
2929
{
30-
public class ExternalAppIncomingTest
30+
public class DicomReidentifierTest
3131
{
32-
private readonly Mock<ILogger<ExternalAppIncoming>> _logger;
32+
private readonly Mock<ILogger<DicomReidentifier>> _logger;
3333
private readonly Mock<IServiceScopeFactory> _serviceScopeFactory;
3434
private readonly ServiceCollection _serviceCollection;
3535
private readonly Mock<IRemoteAppExecutionRepository> _repository;
3636
private readonly Mock<IServiceScope> _serviceScope;
3737
private readonly ServiceProvider _serviceProvider;
3838

39-
public ExternalAppIncomingTest()
39+
public DicomReidentifierTest()
4040
{
41-
_logger = new Mock<ILogger<ExternalAppIncoming>>();
41+
_logger = new Mock<ILogger<DicomReidentifier>>();
4242
_serviceScopeFactory = new Mock<IServiceScopeFactory>();
4343
_repository = new Mock<IRemoteAppExecutionRepository>();
4444
_serviceScope = new Mock<IServiceScope>();
@@ -56,20 +56,20 @@ public ExternalAppIncomingTest()
5656
}
5757

5858
[Fact]
59-
public void GivenExternalAppOutgoing_TestConstructors()
59+
public void GivenDicomDeidentifier_TestConstructors()
6060
{
61-
Assert.Throws<ArgumentNullException>(() => new ExternalAppIncoming(null, null));
62-
Assert.Throws<ArgumentNullException>(() => new ExternalAppIncoming(_logger.Object, null));
61+
Assert.Throws<ArgumentNullException>(() => new DicomReidentifier(null, null));
62+
Assert.Throws<ArgumentNullException>(() => new DicomReidentifier(_logger.Object, null));
6363

64-
var app = new ExternalAppIncoming(_logger.Object, _serviceScopeFactory.Object);
64+
var app = new DicomReidentifier(_logger.Object, _serviceScopeFactory.Object);
6565

6666
Assert.Equal(app.Name, app.GetType().GetCustomAttribute<PlugInNameAttribute>()!.Name);
6767
}
6868

6969
[Fact]
7070
public async Task GivenIncomingInstance_WhenExecuteIsCalledWithMissingRecord_ExpectErrorToBeLogged()
7171
{
72-
var app = new ExternalAppIncoming(_logger.Object, _serviceScopeFactory.Object);
72+
var app = new DicomReidentifier(_logger.Object, _serviceScopeFactory.Object);
7373

7474
var studyInstanceUid = DicomUIDGenerator.GenerateDerivedFromUUID().UID;
7575
var seriesInstanceUid = DicomUIDGenerator.GenerateDerivedFromUUID().UID;
@@ -89,7 +89,7 @@ public async Task GivenIncomingInstance_WhenExecuteIsCalledWithMissingRecord_Exp
8989
[Fact]
9090
public async Task GivenIncomingInstance_WhenExecuteIsCalledWithRecord_ExpectDataToBeFilled()
9191
{
92-
var app = new ExternalAppIncoming(_logger.Object, _serviceScopeFactory.Object);
92+
var app = new DicomReidentifier(_logger.Object, _serviceScopeFactory.Object);
9393

9494
var studyInstanceUid = DicomUIDGenerator.GenerateDerivedFromUUID().UID;
9595
var seriesInstanceUid = DicomUIDGenerator.GenerateDerivedFromUUID().UID;

tests/Integration.Test/StepDefinitions/RemoteAppExecutionPlugInsStepDefinitions.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public async Task AStudyThatIsExportedToTheTestHost()
124124
WorkflowInstanceId = Guid.NewGuid().ToString(),
125125
};
126126

127-
_exportRequestEvent.PluginAssemblies.Add(typeof(ExternalAppOutgoing).AssemblyQualifiedName);
127+
_exportRequestEvent.PluginAssemblies.Add(typeof(DicomDeidentifier).AssemblyQualifiedName);
128128

129129
var message = new JsonMessage<ExportRequestEvent>(
130130
_exportRequestEvent,
@@ -172,7 +172,7 @@ await _informaticsGatewayClient.MonaiScpAeTitle.Create(new MonaiApplicationEntit
172172
Name = MonaiAeTitle,
173173
Grouping = _dataProvider.StudyGrouping,
174174
Timeout = 3,
175-
PlugInAssemblies = new List<string>() { typeof(ExternalAppIncoming).AssemblyQualifiedName }
175+
PlugInAssemblies = new List<string>() { typeof(DicomReidentifier).AssemblyQualifiedName }
176176
}, CancellationToken.None);
177177
}
178178
catch (ProblemException ex)
@@ -196,6 +196,9 @@ await _informaticsGatewayClient.MonaiScpAeTitle.Create(new MonaiApplicationEntit
196196
(await Extensions.WaitUntil(() => _dicomServer.Instances.ContainsKey(key), DicomScpWaitTimeSpan)).Should().BeTrue("{0} should be received", key);
197197
}
198198

199+
// Clear workflow request messages
200+
_receivedWorkflowRequestMessages.ClearMessages();
201+
199202
// Send data received back to MIG
200203
var storeScu = _objectContainer.Resolve<IDataClient>("StoreSCU");
201204

0 commit comments

Comments
 (0)