[
https://issues.apache.org/jira/browse/FINERACT-2906?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18125468#comment-18125468
]
Vladyslav Samchenko commented on FINERACT-2906:
-----------------------------------------------
[~suvrat] It also confused me a bit because the task was previously numbered
2900, but now it’s 2906. That’s why the link broke.
> SmsDataValidator does not reject a null staffId on SMS creation
> ---------------------------------------------------------------
>
> Key: FINERACT-2906
> URL: https://issues.apache.org/jira/browse/FINERACT-2906
> Project: Apache Fineract
> Issue Type: Bug
> Reporter: Vladyslav Samchenko
> Assignee: Vladyslav Samchenko
> Priority: Trivial
> Fix For: 1.16.0
>
>
> {{SmsDataValidator.validateForCreate}} accepts a JSON payload containing an
> explicit {{"staffId": null}} without raising a validation error. However, the
> only consumer of this validator, {{{}SmsMessageAssembler{}}}, cannot handle a
> null {{{}staffId{}}}: it unconditionally calls
> {{{}StaffRepositoryWrapper.findOneWithNotFoundDetection(null){}}}, which
> fails with an {{IllegalArgumentException}} from Spring Data's
> {{Assert.notNull}} rather than a domain-specific validation exception.
> The two components are inconsistent. Either {{staffId = null}} is a valid
> input, in which case the assembler must handle it, or it is invalid, in which
> case the validator must reject it. They cannot both be correct, so at least
> one component is defective regardless of the original intent.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)