diff --git a/EventsHandler/Api/EventsHandler/Services/DataProcessing/Strategy/Implementations/TaskAssignedScenario.cs b/EventsHandler/Api/EventsHandler/Services/DataProcessing/Strategy/Implementations/TaskAssignedScenario.cs index 71d01e69..44a7acb6 100644 --- a/EventsHandler/Api/EventsHandler/Services/DataProcessing/Strategy/Implementations/TaskAssignedScenario.cs +++ b/EventsHandler/Api/EventsHandler/Services/DataProcessing/Strategy/Implementations/TaskAssignedScenario.cs @@ -57,11 +57,13 @@ protected override async Task PrepareDataAsync(NotificationEvent n } // Validation #2: The task needs to be assigned to a person - if (this._taskData.Identification.Type != IdTypes.Bsn) - { - throw new AbortedNotifyingException(Resources.Processing_ABORT_DoNotSendNotification_TaskNotPerson); - } - + // TODO: Disabled this check and its corresponding test because this is no longer correct + // TODO: We should expand this check with a check on the involvedPartyUri being correct + //if (this._taskData.Identification.Type != IdTypes.Bsn) + //{ + // throw new AbortedNotifyingException(Resources.Processing_ABORT_DoNotSendNotification_TaskNotPerson); + //} + CaseType caseType = await this._queryContext.GetLastCaseTypeAsync( // 3. Case type await this._queryContext.GetCaseStatusesAsync( // 2. Case statuses this._taskData.CaseUri)); // 1. Case URI diff --git a/EventsHandler/Tests/UnitTests/EventsHandler.Tests/Services/DataProcessing/Strategy/Implementations/TaskAssignedScenarioTests.cs b/EventsHandler/Tests/UnitTests/EventsHandler.Tests/Services/DataProcessing/Strategy/Implementations/TaskAssignedScenarioTests.cs index e2230306..e0b5f4e7 100644 --- a/EventsHandler/Tests/UnitTests/EventsHandler.Tests/Services/DataProcessing/Strategy/Implementations/TaskAssignedScenarioTests.cs +++ b/EventsHandler/Tests/UnitTests/EventsHandler.Tests/Services/DataProcessing/Strategy/Implementations/TaskAssignedScenarioTests.cs @@ -131,27 +131,27 @@ public void TryGetDataAsync_ValidTaskType_Closed_ThrowsAbortedNotifyingException }); } - [Test] - public void TryGetDataAsync_ValidTaskType_Open_NotAssignedToPerson_ThrowsAbortedNotifyingException() - { - // Arrange - INotifyScenario scenario = ArrangeTaskScenario_TryGetData( - DistributionChannels.Email, - s_taskOpenNotAssignedToPerson, - true, - true); - - // Act & Assert - Assert.Multiple(() => - { - AbortedNotifyingException? exception = - Assert.ThrowsAsync(() => scenario.TryGetDataAsync(s_validNotification)); - Assert.That(exception?.Message.StartsWith(Resources.Processing_ABORT_DoNotSendNotification_TaskNotPerson), Is.True); - Assert.That(exception?.Message.EndsWith(Resources.Processing_ABORT), Is.True); + //[Test] + //public void TryGetDataAsync_ValidTaskType_Open_NotAssignedToPerson_ThrowsAbortedNotifyingException() + //{ + // // Arrange + // INotifyScenario scenario = ArrangeTaskScenario_TryGetData( + // DistributionChannels.Email, + // s_taskOpenNotAssignedToPerson, + // true, + // true); + + // // Act & Assert + // Assert.Multiple(() => + // { + // AbortedNotifyingException? exception = + // Assert.ThrowsAsync(() => scenario.TryGetDataAsync(s_validNotification)); + // Assert.That(exception?.Message.StartsWith(Resources.Processing_ABORT_DoNotSendNotification_TaskNotPerson), Is.True); + // Assert.That(exception?.Message.EndsWith(Resources.Processing_ABORT), Is.True); - VerifyGetDataMethodCalls(1, 1, 0, 0, 0); - }); - } + // VerifyGetDataMethodCalls(1, 1, 0, 0, 0); + // }); + //} [Test] public void TryGetDataAsync_ValidTaskType_Open_AssignedToPerson_NotWhitelisted_ThrowsAbortedNotifyingException()