COAR NotifyService IT failures: NotifyServiceInboundPatternsRemoveOpe… #451
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bug issue at DSpace github
All NotifyServiceInboundPatternsRemove*IT classes has the supports() method: returning true, the class is used to manage the incoming patch request. This boolean is calculated by matching the path sting to the string /notifyServiceInboundPatterns . This path is used as the initial part of many NotifyServiceInboundPattern*Operation classes.
org.dspace.app.rest.repository.patch.operation.ldn.NotifyServiceInboundPatternsRemoveOperation
is the backend service to delete all the inboundPatterns of a given notifyServiceEntity. It's supports() method is evaluated as true even if the http patch call had the path /notifyServiceInboundPatterns[1]/constraint - and it is wrong because the correct backend to be triggered should be org.dspace.app.rest.repository.patch.operation.ldn.NotifyServiceInboundPatternConstraintRemoveOperation
That said - the solution is to add the condition
&& path.endsWith(OPERATION_PATH)
to the supports() method return condition on NotifyServiceInboundPatternsRemoveOperation class.