Clarification on RESTWS-735

For this ticket, we found this code segment:

and we were wondering which method calls exactly needed to be replaced with the newDelegate function that takes in the SimpleObject. The ticket is a little unclear and only mentions that the “old” method calls needed to be replaced, but we don’t exactly know what that old function is that needs to be replaced. We are just looking for some clarification on the matter. Thanks!

Here is an example of where the replacement should happen: https://github.com/openmrs/openmrs-module-webservices.rest/blob/master/omod-common/src/main/java/org/openmrs/module/webservices/rest/web/resource/impl/DelegatingSubResource.java#L93

Look for all such calls and replace them with the new method which takes a SimpleObject.

If there are no declarations of a SimpleObject in a method where newDelegate() is called, do I just leave the function call as is?

That is correct.

If that’s the case, the only place where we ever found a change to be made was the exact example you sent us. Are we missing something?

Just do a pull request for any parts you find.

how do we test our changes?

In this case you just have to make sure the unit tests for that create() method where you have introduced the changes are passing as before. I think that would be sufficient because the contract hasn’t been changed, only the implementation.

We’ve submitted our pull request, which can be found here: https://github.com/openmrs/openmrs-module-webservices.rest/pull/398

Please take a look when you have a moment! Thanks!