Skip to content

Commit

Permalink
Merge pull request #86 from Worth-NL/task_company_v2
Browse files Browse the repository at this point in the history
Removed validation for BSN, as we have a fallback to get it from case…
  • Loading branch information
frankmolenaar1986 authored Oct 15, 2024
2 parents 45d3d81 + ea4b355 commit ed8853d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,13 @@ protected override async Task<PreparedData> 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<AbortedNotifyingException>(() => 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<AbortedNotifyingException>(() => 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()
Expand Down

0 comments on commit ed8853d

Please sign in to comment.